Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core-nav: parent categories not seen as active #730

Open
onli opened this issue May 11, 2020 · 4 comments
Open

Core-nav: parent categories not seen as active #730

onli opened this issue May 11, 2020 · 4 comments

Comments

@onli
Copy link
Member

onli commented May 11, 2020

Normally, when you select a category as target for a menu option, when you visit that category the menu option gets printed without the a, it is then marked as active. Skeleton does that for example, using the same logic as 2k11. However, that detection fails when the menu options links to a parent category (a category that has one or multiple subcategories). No menu options is marked as active in that case.

@onli onli added this to the 2.3.6 milestone May 11, 2020
@onli onli changed the title Core-nav: Oberkategories not seen as active Core-nav: parent categories not seen as active May 11, 2020
@yellowled
Copy link
Member

yellowled commented May 11, 2020

This is prepared in config.inc.php:

$serendipity['smarty']->assign(array('currpage'  => "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'],
                                     'currpage2' => $_SERVER['REQUEST_URI']));

and then usually used in index.tpl:

{if $currpage==$navlink.href or $currpage2==$navlink.href}{/if}

I don't know why or how these would not match up for parent categories, but I don't see how this would be an issue with CSS or templating. (Therefore, I sadly have no idea how to address this.)

Edit: Core themes that use this are 2k11, bootstrap4, bulletproof, next, skeleton, timeline. I guess every theme that uses core nav uses this. The fact that bulletproof uses it indicates how long this has been that way. Also, multiple additonal themes use it.

@yellowled yellowled removed their assignment May 11, 2020
@onli
Copy link
Member Author

onli commented May 11, 2020

Yeah, I'm really surprised about that bug, and it might be related to something not directly involved. I had hoped the smart code is your work :) Well, we will figure it out.

@onli onli added the bugs label May 11, 2020
@yellowled
Copy link
Member

I mean, the likely solution is that for the URL or a category page of a parent category, neither currpage nor currpage2 is a "correct" match for some odd reason. I have no idea why it would be, though. (Mainly because I don't use child categories and have no clue what makes up their URLs.)

@onli
Copy link
Member Author

onli commented May 11, 2020

That's the thing: If I'm not mistaken it's the exact same url. Just a link to a category. That it's a parent/or child category is just a setting in the database.

But maybe I'm missing something, given the code that should be impossible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants