Download
We're evolving to serve you better! This current forum has transitioned to read-only mode. For new discussions, support, and engagement, we've moved to GitHub Discussions.

Need help with Publii “menus” options

  • #5748
    Avatar photo[anonymous]

    Hi friends and devs. I think this is an easy situation but it became hard for me. I created a menu with 6 menu items. Some of the menu items have type as a frontpage, some as a post link. Now I need to give to menu item a role of link to section in index file. I don’t need to link to another file, I just want to scroll to section in index file.
    .
    In static webdev (without cms) I just create menu item “li” with “a” and as href = “#section_name” and in index.htm – section with id = “section_name”. Easy. But in case of Publii menu I am confused now))   I thought that this is a role of “internal link” but in this case #section_name is not working.
    .
    How to scroll to the exact section in index file with a help of Publii Menu item?

    #5751
    Avatar photo[anonymous]

    I am speaking about anchor links with a help of “add menu item”

    #5752
    Avatar photoBob

    Exactly the Internal option is the best for your needs. Note that it will work on the live server only.

    Solution:
    Select an Internal link and enter #section_name in the Internal URL field.

    #5753
    Avatar photo[anonymous]

    I was trying locally with “preview your changes”. Thank you Bob, will try again on live server

    #5756
    Avatar photo[anonymous]

    Hi Yaroslav,

    I link page sections using external link.

    E.g.: assign the id to a section:

    In the menu I just set external link URL to #contacts, like this: https://imgur.com/a/kobslkP

    It works fine for me.

    Thank you! I was doing the same way, but didn’t know that it is not working in “preview your changes” mode. Will test on live server this days )