If you edit any row in Page Builder (2.0+) you’ll notice an Attributes tab at the top right of the modal window. Opening that reveals three fields:
Row Class
Cell Class
CSS Styles
A similar option is available when editing Widgets. In this thread we’ll briefly cover row attributes and how to use them. This overview assumes a basic understanding of CSS.
Row Class
I’ve added a row class and called it:
test-row-class
If we now go inspect the page source we see that the very first div in the row looks like this:
<div class="panel-row-style-test-row-class test-row-class panel-row-style">
So now we have a custom row class that we can target in our own CSS, be it theme stylesheet, child theme stylesheet or Custom CSS.
Note that there is no period before test-row-class when I add it to the Page Builder field. However when I target that class in my CSS I do need a period in front of it.
.test-row-class { /* My styles for test row class go here */ }
Cell Class
I’ve added a test cell class:
test-cell-class
Now let’s go inspect the page source and see where this is being applied:
<div class="panel-row-style-test-row-class test-row-class panel-row-style"> <div class="panel-grid-cell" id="pgc-1459-0-0"> <div class="test-cell-class panel-cell-style">
Now we can see both our row class and cell class being applied. As with our row class before we can now target this cell class in our own stylesheet, wherever that may be:
.test-cell-class { /* My styles for test row class go here */ }
CSS Styles
Lastly let’s take a the CSS Styles field. This field will add inline styles to the row div. Not the cell div the row div. You can add one per line and don’t need a semi-colon at the end, for example:
color: red
Let’s take a look and see how that looks in the page source:
<div class="panel-row-style-test-row-class test-row-class panel-row-style" style="color: red;"> <div class="panel-grid-cell" id="pgc-1530-0-0"> <div class="test-cell-class panel-cell-style">
Now we can see all three row Attributes in play. Our row class, cell class and inline CSS Styles.
Conclusion
If you’ve got a handle on row attributes then widget attributes will make sense.
Feel free to post questions on this topic below.
Please, find an blog post on this topic here.
Page Builder user documentation can be found here: Page: Getting Started With Page Builder.
Hi Andrew
I can’t get the above to work on wordpress 4.6.1 using modern themes bldr pro.
absolutely nothing happens
Ben
Hi Ben
Have you inspected the source code using your browser’s developer tool? The first item to confirm would be, is your custom ID or class outputting? Once that’s confirmed you can then go down the line and check your CSS by inspecting the item you’re targeting to see if your rule is perhaps being overridden by another rule with greater specificity.
Ok, I’ll check.
Let me explain what I’m trying to do and let me know if possible
What I need is for a client to be able to turn on and off visibilty of a row or widget to front end page.
Whould be great to have a siteorigen toggle for this.
So in row edit i left id blank
added row-a-class to row
and added .row-a {visibility: collapse;}
What do you think
I see one thing I did wrong, should be visibility: collapse in edit rows> attributes> css styles
But still now working. I wouldn’t know if it is getting blocked by viewing inspect mode
Sorry meant still NOT working
If you add:
to the row attributes class field then you’d need to add to your Custom CSS plugin or child theme style.css file:
In your example above you initially mention row-a-class and then target that with .row-a .
Also, if you use the CSS Styles field, you must only put declarations like:
That field can’t accept rules.
You should do one of the following.
Use a row class and matching Custom CSS:
OR use CSS Styles but not both:
Ok , I did the very last example you have in the CSS Styles, but nothing happens.
Please, send a link to the page concerned and we’ll take a look.
This is a private message.
I can’t seem to login with those details. Please, can you just send me the link to the post on the front end of your site. Thanks.
Ok
demo.com-products.co
If you’d like to use Custom CSS then it’s really handy to inspect your code. If you don’t use your browser’s developer tool then you’re working in the dark, inputting rules and styles on one side but not able to check if they’re being outputted on the other. Here is a post on using the inspector: https://developers.google.com/web/tools/chrome-devtools/inspect-styles/. There are many others, that’s just one that came up when I checked.
display: none isn’t anywhere in your page source. I’m not sure why, but your styles aren’t being outputted to the page. That row has an ID of home-testimonials so in your Custom CSS plugin of choice you could say:
Ok, thanks for the inspector link.
Using the custom css will help to a degree. I really was needing our client to be able to just type in the “none” in the pages row edit area. The client would not have access to Custom CSS so they wouldn’t be able to customize there page in that way.
Any way to find out why it’s not working? Is it a glitch in siteorigin or coulkd another plugin be blocking it?
Thanks for your help
This is strange, putting #home-testimonials { display: none; } into Custom CSS isn’t working either
A caching plugin could be the reason. Is there one being used?
What Custom CSS plugin are you using?
Simple Custom CSS By John Regan, Danny Van Kooten
I deactivated it and it didn’t help the Row CSS
I haven’t installed a caching plugin. I am using BLDR by modern themes which has revisions history logged at bottom of page.
Who is the site hosted with? GoDaddy, for example, has a caching link at the top of the page in WP? Can you perhaps open a new support thread and I’ll try to assist further there. This is quite specific now, your row attributes aren’t reflecting: Page: New Thread. If you send me the link to your thread once open, I’ll assist. Thanks.
Thanks Andrew
I’m using Hostgator
New thread
Page: SiteOrigin – Free WordPress Themes and Plugins
Thanks