This thread is over two years old and may be outdated. Please create a new thread if you need help, or email us if you have an active Premium license.

Page Builder class names, please!

11 years ago · Last reply by Swing Graphics 11 years ago

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.

Need fast email support? Get SiteOrigin Premium

Replies

10
  1. Andrew Misplon Staff 11 years, 4 months ago

    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. Swing Graphics 11 years, 4 months ago

    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. Andrew Misplon Staff 11 years, 4 months ago

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

  4. Andrew Misplon Staff 11 years, 4 months ago

    Apologies for missing the point earlier.

  5. Swing Graphics 11 years, 4 months ago

    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. Andrew Misplon Staff 11 years, 4 months ago

    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. Tomek Cichy 11 years, 3 months ago

    @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. Swing Graphics 11 years, 3 months ago

    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. Tomek Cichy 11 years, 3 months ago

    @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. Swing Graphics 11 years, 3 months ago

    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.

Have a different question or issue?

Start New Thread