Highlight current page in the nav block

Hey,

I’m not quite sure if this is a bug or if I’m just misunderstanding the function. I’m building a menu with the new nav block and I want to highlight the current page.

To my understanding this should be achievable under styles > nav links > current page. But nothing happens if I change the styles there.

Kind regards
Marco

Hi @MarcovB,

Sorry to hear you’re experiencing trouble with this.

Unfortunately, I haven’t been able to reproduce this error on my end.
As I don’t have enough information on your setup, I cannot determine what might be going wrong.

Could you possibly confirm you are on the latest version?
Additionally, do the styles not apply in the editor or on the frontend?

Thank you in advance.

Mhh, I’ve tested in on two sites. Both have the newest cwicly version. One site has woocommerce installed, the other only cwicly. I also regenerated html/css.

The styles don’t apply on backend and frontend. If I inspect the html code on the frontend, there’s no “current” class or something similar applied to the menu link of the current page. Otherwise I would easily do it with relative styling. :sweat_smile:

Hi. i also have the same issue. theres no current class on navlink if its current page. have you solve this issue?

also I cannot see data attribute aria.

@Araminta

No, I haven’t solved it yet. But I haven’t paid much attention to it in the last few days either.:sweat_smile:

Hello Marco,

Sorry to hear about the trouble you’re experiencing here.

Might I ask how you are applying the links? Are these custom URLs or are you using the post selector in the URL input field?

If these are custom URLs, this might be an issue on our side that should be fixed in the next update.

One is a custom link to a page. If I seach for that page (or any other page), it doesn’t appear in the post selector of the URL input field. Only posts show up.

The other nav link is a dynamic link to the home page.

For test purposes I selected one of the posts that I can choose from in the post selector. Then the styles apply.

1 Like

Thank you for providing this information, @MarcovB!

Currently, the current page styling will only apply for links selected through the URL input field.
Hence why it wasn’t applying on your end.

We do plan to extend the current page styling to custom and dynamic links.
So please bear with us in the meantime.

Could you possibly confirm this is the same case, @kris?
Thank you in advance.

i added the link via cwicly block inspector, then the link icon there then add the link via static url option.

@Araminta

and what do you mean by links selected through the URL input field

Sorry for the confusion, @kris.

By URL input field, I mean are you entering a custom link, or selecting a link from the suggestions?

This is what I mean by suggestions:

URL-input-field

Please don’t hesitate to let me know if you have any more questions.

Hello everyone,

Custom URLs’ state should now be supported in 1.2.9.8.
If you still encounter trouble, please let us know by replying to this thread.

Thanks.

Cheers,

It works for the static links. The dynamic homepage link doesn’t change. If I change it to a static homepage link, the current styles get applied.

I found the reason why only posts and no pages were shown in the url input field: I used a php code snippet to limit the wordpress search to posts. This also affected the URL search in the backend. :sweat_smile:

@Louis, since you have been kind enough to include custom URLs, how about this request :bulb::