0
Welcome Guest! Login
0 items Join Now

SOLVED Page Class Suffix issue

  • SOLVED Page Class Suffix issue

    Posted 9 years 1 month ago
    • I'm having a serious problem with how Gantry does the page class suffix. For all intents and purposes, it should work just like any other class suffix on any module or any other HTML entity. So, why is the gantry framework converting all spaces to dashes?

      when I put in the following tag: <space>rt-myriad-style<space>behind-the-scenes

      I get a page class suffix of: -rt-myriad-style-behind-the-scenes

      What I SHOULD get is: <space>rt-myriad-style<space>behind-the-scenes

      If I got what I should get, I could then reference this page with a body class of behind-the-scenes.

      And, Yes, I know there is a menu-behind-the-scenes tag on there and I can use that. But, what if I want to define my own page classes that have nothing to do with menus, or anything YOU have thought of already. I want to be able to put in the page class area on page display and have it do what most standard templates do and just add this class tag to the end of the body tag as I have defined it and not as you think it should be.

      What can I do to resolve this?
    • Last Edit: 9 years 1 month ago by Times Two Technology. Reason: Issue solved
    • Henning's Avatar
    • Henning
    • Preeminent Rocketeer
    • Posts: 29362
    • Thanks: 954
    • Volunteer

    Re: Page Class Suffix issue

    Posted 9 years 1 month ago
  • Re: Page Class Suffix issue

    Posted 9 years 1 month ago
    • The attribute selector STILL does not allow for me to put my own classes on the body tag through the page class suffix in the proper way as I could with any other template that didn't do the same as Rockettheme forces via Gantry.

      So basically, there is no fix and no way to get it to do what the standard would allow while a rockettheme template?

      I would need to handcode this into my index.php to add the page class suffix myself in the proper way?

      Is there a way to override or remove this portion of the gantry framework myself via coding and add the suffix in myself in the proper way?
    • Henning's Avatar
    • Henning
    • Preeminent Rocketeer
    • Posts: 29362
    • Thanks: 954
    • Volunteer

    Re: Page Class Suffix issue

    Posted 9 years 1 month ago
    • a class like

      <body class="-rt-myriad-style-behind-the-scenes">

      (just to take an example)

      could be used in a css file like

      body[class*="rt-myriad"] {some css goes here}

      body[class*="behind-the-scenes"] {some css goes here}

      you could also write your own gantry feature using the $gantry->addBodyClass('some class goes here'); function ...

      and btw. not every template does add the page class to the body tag ... usually it's just added to the component area.
    • Last Edit: 9 years 1 month ago by Henning.
  • Re: Page Class Suffix issue

    Posted 9 years 1 month ago
    • Thank you for that example. I did not entirely understand that type of usage of the attributes. That does make sense now, but still makes it a bit more difficult to understand. It is powerful, but less "user friendly" and readable when you are looking for something and don't know how things were put together.

      I'll look into the addBodyClass function in the gantry documentation.

      Please mark this as "solved" as I don't see an easy way to do that myself.
    • Henning's Avatar
    • Henning
    • Preeminent Rocketeer
    • Posts: 29362
    • Thanks: 954
    • Volunteer

    Re: Page Class Suffix issue

    Posted 9 years 1 month ago
    • you can edit the title of your first post by adding [solved]

Time to create page: 0.048 seconds