Home>Support>Page Builder class names, please!

Page Builder class names, please!

Grid cells or their parent div should have a class name indicating how many of them their are so that styles can be applied across pages, or even for multiple rows on the same page. For example, wherever I create a row with 4 columns, I want them to have similar styling. (I *know* somebody is going to say “Just use `panel-grid-cell` or `:nth-child` blah blah” if I don’t point out the obvious reasons for needing class names: I want these to be styled differently from rows of 1 or 2 or 5 columns, etc.)

The current id system creates lots of redundant CSS. Let me say I am also not a fan of the per-page stylesheet requests.

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 9 years, 11 months ago Andrew Misplon
    Hi, I Work Here

    Hi Greg

    Thanks for your support and feedback.

    There is a significant refactoring and expansion of Page Builder currently underway. User inputted classes is a long standing request and will be included in a future update.

    If you have a specific challenge you’re working through now; there are unique ID’s outputted so it’s definitely possible to target specific content – albeit not the setup you’d prefer.

  2. 9 years, 11 months ago Swing Graphics

    I’m aware of the IDs. That misses the point entirely. Having unique IDs causes the problem because it means duplicating code for every instance of a row, and adding new selectors every time a new row is created, which is ridiculous and doable by an end-user. User-inputted classes will not help, either. I can already add classes with `add_filter( ‘siteorigin_panels_row_styles’ …)`, but that requires the user to remember to add that to every single row they create. Every row with n columns should have a class like “panel-grid-columns-n” to allow consistent styling.

  3. 9 years, 11 months ago Andrew Misplon
    Hi, I Work Here

    For sure, I understand the challenge you’re running into. This is solid feedback. I’ve logged a feature request on our side.

  4. 9 years, 11 months ago Andrew Misplon
    Hi, I Work Here

    Apologies for missing the point earlier.

  5. 9 years, 11 months ago Swing Graphics

    Cheers. I’m sure this will develop into a truly fantastic plugin. I already like it so much better than the others I’ve tried!

  6. 9 years, 11 months ago Andrew Misplon
    Hi, I Work Here

    Thanks for hanging in there with us. Page Builder has developed into the core of SiteOrigin, it’s development will definitely be ongoing and hopefully improve the experience on your side as we progress.

    Chat soon.

  7. 9 years, 11 months ago Tomek Cichy

    @Swing, check out my plugin http://nyinker.com/siteorigin-panels-class.zip it adds classes to Page Builder without modifing the original plugin. If you like it, spread the word ;)

  8. 9 years, 11 months ago Swing Graphics

    A user on https://wordpress.org/support/topic/page-builder-and-widget-css-classes pointed, “if you switch the order of rows right now, the ID changes so the css for the rows don’t work anymore.” Yikes! +2 for better class names.

    @Tomek That looks useful for other purposes, but it doesn’t address the issue in my original post.

  9. 9 years, 11 months ago Tomek Cichy

    @Swing, Great idea, I’ve just added the class that says how many columns the row has. re-download it again from http://nyinker.com/siteorigin-panels-class.zip . Ps. sorry for not reading the issue carefully the first time ;)

  10. 9 years, 11 months ago Swing Graphics

    I’m not a fan of the extra divs it adds. This type of layout already so often suffers from div-itis.

    But you did inspire me to go filter hunting, thank you!

    Solved my problem in 10 minutes. :-D

    function fkms_panels_row_classes( $classes, $grid ) {
    	$classes[] = 'cell-count-' . $grid['cells'];
    	return $classes;
    }
    add_filter( 'siteorigin_panels_row_classes', 'fkms_panels_row_classes', 10, 2 );
Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More