Mr Lucky Well-known member Dec 3, 2017 #1 Can someone please tell me how I would style the current subnavigation menu item? Thanks
Mike XenForo developer Staff member Dec 3, 2017 #2 As in things like "new posts" etc? Those are never tracked as selected -- just the top level section is. Upvote 0 Downvote
As in things like "new posts" etc? Those are never tracked as selected -- just the top level section is.
Mr Lucky Well-known member Dec 3, 2017 #3 Mike said: As in things like "new posts" etc? Those are never tracked as selected -- just the top level section is. Click to expand... So would this never be possible? Upvote 0 Downvote
Mike said: As in things like "new posts" etc? Those are never tracked as selected -- just the top level section is. Click to expand... So would this never be possible?
BassMan Well-known member Dec 3, 2017 #4 In Style Properties -> Header and navigation? Upvote 0 Downvote
Mr Lucky Well-known member Dec 3, 2017 #5 BassMan said: In Style Properties -> Header and navigation? View attachment 163193 Click to expand... Can you get any of those to style a current subnavigation? I couldn't. How did you do it? Upvote 0 Downvote
BassMan said: In Style Properties -> Header and navigation? View attachment 163193 Click to expand... Can you get any of those to style a current subnavigation? I couldn't. How did you do it?
Mr Lucky Well-known member Dec 3, 2017 #7 I don't understand? That seems to be the whole row, not the current item. Upvote 0 Downvote
BassMan Well-known member Dec 3, 2017 #8 Mr Lucky said: current item Click to expand... Oh, sorry, missed that... I guess it's time to sleep.... You mean for example Watched sublink in subnavigation? Not sure about that. Sorry. Upvote 0 Downvote
Mr Lucky said: current item Click to expand... Oh, sorry, missed that... I guess it's time to sleep.... You mean for example Watched sublink in subnavigation? Not sure about that. Sorry.
Mike XenForo developer Staff member Dec 4, 2017 #9 Mr Lucky said: So would this never be possible? Click to expand... Not with a simple CSS change no. It would need to be tracked within the code. Upvote 0 Downvote
Mr Lucky said: So would this never be possible? Click to expand... Not with a simple CSS change no. It would need to be tracked within the code.
C Case Well-known member Dec 4, 2017 #10 A bit of a hack but you could use the [attribute] selectors. Each of the sub-navigation links have a [data-nav-id] So you could add something like the following to extra.less to style the individual links... Code: [data-nav-id="whatsNewPosts"] { color: red !important; } If you wanted to style a link on a specific page then you could use the <body> [data-template] Code: [data-template="news_feed"] { [data-nav-id="whatsNewNewsFeed"] { color: red !important; } } eg. This makes the 'Your news feed' link red on this page: https://xenforo.com/community/whats-new/news-feed Not sure if this would work for all the sub-navigation links. You would have to check. Upvote 0 Downvote
A bit of a hack but you could use the [attribute] selectors. Each of the sub-navigation links have a [data-nav-id] So you could add something like the following to extra.less to style the individual links... Code: [data-nav-id="whatsNewPosts"] { color: red !important; } If you wanted to style a link on a specific page then you could use the <body> [data-template] Code: [data-template="news_feed"] { [data-nav-id="whatsNewNewsFeed"] { color: red !important; } } eg. This makes the 'Your news feed' link red on this page: https://xenforo.com/community/whats-new/news-feed Not sure if this would work for all the sub-navigation links. You would have to check.
Mr Lucky Well-known member Dec 4, 2017 #11 Thanks, but I think that would style specific links, not just the currently selected. Upvote 0 Downvote
C Case Well-known member Dec 4, 2017 #12 The 2nd part could style a link on the current page but you would have to add the code for all the different pages. Upvote 0 Downvote
The 2nd part could style a link on the current page but you would have to add the code for all the different pages.