0
Welcome Guest! Login
0 items Join Now

Gantry 5: how to get page class associated with menu item alias

    • shenk's Avatar
    • shenk
    • Hero Rocketeer
    • Posts: 424
    • Thanks: 11

    Gantry 5: how to get page class associated with menu item alias

    Posted 9 years 8 months ago
    • In gantry 4, by default `body` has class associated with menu item alias. For example, in home page, the `body` will have a class named 'menu-home'; for 'about us' page with menu item alias set to 'about-us', the `body` will have a class named 'menu-about-us'. This feature is great for tweaking different styles for different pages, however, it is nowhere to be found in gantry 5. A similar thing I can find in the body class is 'itemid-xxx', while this can do the trick, but it is not very intuitive as gantry 4 was. Is there anyway to go back to the old style?
    • Last Edit: 9 years 8 months ago by shenk.
    • MrT's Avatar
    • MrT
    • Preeminent Rocketeer
    • Posts: 101084
    • Thanks: 13484
    • Web Designer/Developer

    Re: Gantry 5: how to get page class associated with menu item alias

    Posted 9 years 8 months ago
    • Gantry 5 is better using itemid-xxx as you can now change alias without having to change any custom CSS that might use this. You can add your own page class on the menu items and that will also be rendered on the body tag. But, to answer you question, no, there is no way to go back to the old Gantry 4 menu-alias class (unless you put them on the menu item manually).

      Regards, Mark.
    • The following users have thanked you: shenk

    • Please search forums before posting. Please make sure your post includes the version of the CMS you are using and a link to the problem. Annotations on screenshots can also be helpful to explain problems/goals. Please use the "secure" tab for confidential information.

Time to create page: 0.058 seconds