- This topic has 9 replies, 3 voices, and was last updated 9 months, 3 weeks ago by Tom.
November 26, 2019 at 10:30 am #1078363Antar
I would be very useful if I could add a css class to a page layout element. From what I can see the element creates/modifies a div with the id=content and class=site-content.
Why not give users the opportuniuty to insert their own class too? This would open up a host of customisation options for the main page content.
Just a thought.
AntarNovember 26, 2019 at 10:48 am #1078383LeoStaffCustomer SupportNovember 26, 2019 at 11:07 am #1078412Antar
Hi, Leo –
This idea stems from my client asking to see two versions of their site design in one demo. They want to see a full-width version and a boxed version simply by visiting different pages on the site.
It occurred to me this would be very useful but I would need to lay down some extra CSS classes to make it all happen. Ideally it would be great if a page element layout would allow me to insert my own class into the body and the main content area. That would allow me to create a boxed design from a full-width set-up pretty easilly. It’s not just the page width but also the background colours and text alignment.
I can do it with snippets. It would be even better if I could do inside GP.
AntarNovember 26, 2019 at 11:24 am #1078433LeoStaffCustomer Support
You should be able to use the page builder container options in the layout element module for the fullwidth vs boxed requirement:
I can’t really recall someone else requesting this so I’m not sure if a feature like this would be useful for the majority of users.
If we add custom class option to the site-content div, then what about header, footer and sidebar etc? Could end up with lots of extra code.
Keep in mind that we try to keep GP lightweight and fast 🙂November 26, 2019 at 11:26 am #1078435Antar
Sure. I understand. How about just a class to the body?
AntarNovember 26, 2019 at 11:45 am #1078473LeoStaffCustomer SupportNovember 27, 2019 at 10:18 am #1080149Antar
Hi, Leo –
I use this snippet a lot. What I need is a conditional that will allow me to hook it to an element layout. So if “this” layout is asigned to a page, then run the body class code.
Can it be done?November 27, 2019 at 4:50 pm #1080576TomLead DeveloperLead Developer
Interesting – so an input in the Layout Element which adds a body class? I could see that being helpful to some users. Will think on it 🙂November 27, 2019 at 11:30 pm #1080816Antar
Hi, Tom –
Yes, that’s the idea. Being able to assign a unique body class to every element layout would open up a range of possibilities. The more you think about it the more sense it makes.November 28, 2019 at 9:17 am #1081763
- You must be logged in to reply to this topic.