Skip Navigation

[Resolved] container class for layout

This support ticket is created 6 years ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 7 replies, has 2 voices.

Last updated by Akhil 6 years ago.

Assisted by: Beda.

Author
Posts
#1137345

Hi. i think there is a need to able to add class for container that created by the layout.

Boot strap by default css is :

.container {
margin-left: auto;
margin-right: auto;
padding-left: 15px;
padding-right: 15px;
}

most of the time this need to be adjusted according to our need , most of the time we need to enter it under the css tab . this is time consuming, pls consider.

#1137351
#1137468
Bildschirmfoto 2018-10-31 um 10.34.04.png

I think what I show on the screenshot is what you look for.
It's present when you edit the Rows.
This will figure as a "container ddl-remove-bs-padding" class on the front end

#1137544

Hi Beda, thanks, i am aware of this. what if need more styling for the containers?

#1138085
#1139753

Nice !

https://toolset.com/documentation/programmer-reference/layouts-framework-api/#ddl-get-container-class

can i add page id into the container class then ? thanks !

#1141184

Some frameworks use different CSS classes for the main content container tag.

This filter is meant to define or override this CSS class to define a container element.

So, no, you cannot target the ID but the Class only.
But of course, with PHP you can get any value you want and populate that CSS class with whatever you get from your custom code (for example, page ID)
How to get a page ID is however not something handled in that DOC or support.

Only how to change the container class is what's supported, so basically:

add_filter('ddl-get_container_class', function( $el ){
    $anything_string = 'populate with whatever you need';
    return $anything_string;
});
#1145104

My issue is resolved now. Thank you!