Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
817 views
in Q2A Core by
edited by

The bug is similar to http://www.question2answer.org/qa/12163/minor-bug-sub-menu-item-recent-always-appears-selected but this time it is the custom page link.

In my example the custom page is linked to homepage  through $QA_CONST_PATH_MAP=array(

'algarve' => '',
 
But even without this the error remains the same.
 
As long as one hits a custom page the first one remains highlighted, if one clicks on questions (Alle Fragen) it works correctly.
 
Sample here (not finished page but enough to see the bug): 
www.cultura-vallarta.com
Q2A version: 1.5.1
by
I tried to never highlight the link by modifing the css, this can be done by adding this to the css file.

.qa-nav-main-xxxxxx .qa-nav-main-selected {background:#222;}
where xxxxxx is the name of the first custom page and 222 the matching color in my theme.

But it still does not resolve the problem.
by
I couldn't reproduce this and tried www.cultura-vallarta.com but it wasn't available. Can you please let me know when it's up and running?
by
Oh, yes, it is now on www.algarve-portugal.de.
I have deleted my added css, so You can see it better.

Just see how the first menupoint changes if You are on "Ausflüge" or "Alle Fragen" (Questions).
by
OK, thanks, I see it now, but I still can't reproduce the problem here. If you wish you can send me a private message with admin access to the site, and I will see exactly how you have it set up, and if I can reproduce it then.

1 Answer

0 votes
by
selected by
 
Best answer

OK, I think the solution is as follows. In function qa_navigation_add_page(...) in qa-app-format.php, change:

$page['tags']

... to ...

($page['tags'].'$')

That signifies to a separate part of Q2A that the custom part of the URL should not be matched as a prefix, but rather only if it is the full thing.

 

by
To other users: The problem only shows up if You add custom pages where the name is part of another custom page.

Example: Custom1 and Custom123 would trigger the problem, as Custom1 is part of Custom123.
...