How to add custom class to layout?
Permalink 1 user found helpful
I'm not sure if I'm being extremely dim here.
I want to add a custom class to a layout via page_theme.php so that it is available as a pickable custom class in the UI when I select 'Edit Layout Design' on an already existant layout with blocks inside.
If I click on 'Edit Layout Design' on a layout I have already added, the pop-up allows me to select the parallax custom template, or I can change the block container class to either enable or disable the grid container
but, where / how do I add custom classes via page_theme.php to make them selectable in the custom classes selector on this form?
Any ideas - I suspect I'm just being a bit dim and missing the obvious.
I want to add a custom class to a layout via page_theme.php so that it is available as a pickable custom class in the UI when I select 'Edit Layout Design' on an already existant layout with blocks inside.
If I click on 'Edit Layout Design' on a layout I have already added, the pop-up allows me to select the parallax custom template, or I can change the block container class to either enable or disable the grid container
but, where / how do I add custom classes via page_theme.php to make them selectable in the custom classes selector on this form?
Any ideas - I suspect I'm just being a bit dim and missing the obvious.
Hi Steev,
thanks for confirming - I wanted to make sure I hadn't missed something obvious. I've been adding the classes in manually as I've been building the theme out but when it comes to a customer adding content in then asking them to remember class names is a bit of a stretch.
thanks for confirming - I wanted to make sure I hadn't missed something obvious. I've been adding the classes in manually as I've been building the theme out but when it comes to a customer adding content in then asking them to remember class names is a bit of a stretch.
Hi AndyJ,
I don't think there is a page_theme.php method for adding custom classes to layouts.
http://documentation.concrete5.org/api/class-Concrete.Core.Page.The...
You might want to make a GitHub issue to suggest that feature.
I don't think there is a page_theme.php method for adding custom classes to layouts.
http://documentation.concrete5.org/api/class-Concrete.Core.Page.The...
You might want to make a GitHub issue to suggest that feature.
Good idea Karl,
I'll raise it on Github - I think there definitely needs to be a way to set those styles in the theme as it is just a big disconnect - everything else you can choose from one picklist or other then suddenly you need to know a class name and key it in.
I'll raise it on Github - I think there definitely needs to be a way to set those styles in the theme as it is just a big disconnect - everything else you can choose from one picklist or other then suddenly you need to know a class name and key it in.
They did build in "Area Classes" though. Perhaps you can do something with that, untill this is available?
http://documentation.concrete5.org/developers/designing-for-concret...
But yeah, seems this functionality has been forgotten or is still on the todo-list. I'm sure they have plenty of stuff to do, so I don't blame 'em haha.
http://documentation.concrete5.org/developers/designing-for-concret...
But yeah, seems this functionality has been forgotten or is still on the todo-list. I'm sure they have plenty of stuff to do, so I don't blame 'em haha.
Hi Ramon,
you're absolutely right - but this will apply the style(s) to the whole area rather than just a layout within an area - which for me at the moment is the missing piece. It's not a show-stopper as the ability to add classes is there - just not in the same way as the other parts of the interface.
you're absolutely right - but this will apply the style(s) to the whole area rather than just a layout within an area - which for me at the moment is the missing piece. It's not a show-stopper as the ability to add classes is there - just not in the same way as the other parts of the interface.
True, it will be adding it to the whole area. I thought perhaps you can use it for your current situation. Just trying to give alternatives, if you don't want to enter it all manually :)
hi, it is definitely a good suggestion and would work. Normally I probably would just do that - it's just in this case there are pages with lots of content in lots of custom layouts with lots of nested styles. I don't really want to add lots of areas and also then have to have 'spare' ones doing nothing for possible expansion.
Hi Andy,
Adding a block handle 'core_area_layout' inside getThemeBlockClasses() in page_theme.php will give you classes for your layouts as a whole (but not granularly to individual preset handles).
Adding a block handle 'core_area_layout' inside getThemeBlockClasses() in page_theme.php will give you classes for your layouts as a whole (but not granularly to individual preset handles).
I suppose the other way would be to make some templates and put them in with the 'parallax' template?
What a good idea. I'll have to have a look to see how they can be added outside of the core but that would definitely work.
I presume you would copy 'core_area_layout' from core blocks to 'application' blocks, rename and add templates?
that's what I'll try first. I know you can't just override everything in 5.7 like you could in 5.6 - but then I guess this isn't an override. If I do have to do anything differently I'll post it back here.
yep - that works fine
Good news.
Meant to say to rename controller path, but you must have worked that out!
Meant to say to rename controller path, but you must have worked that out!
e.g: Class in the css file is '.blue', which gives the area a blue background and makes the text white.
I type in the 'Custom Class' box 'blue' and click the blue box below.