Home>Support>Before and After Rows filter

Before and After Rows filter

Notice: This thread is over two years old; the information may be outdated. Please consider creating a new thread if you require free support. If you have an active SiteOrigin Premium license, you can email our premium support desk at [email protected].

Hello,
I am trying to use the siteorigin_panels_before_row and the siteorigin_panels_after_row filters in my theme, and I am really confused by the documentation, and I can’t get the behavior I want. In fact, I get no behavior at all, which leads me to believe that I’m not using them properly.
Here’s what I am looking for:
I am trying to wrap every row’s content on every page/post in a standard container div. Why? I want the row itself to the be full with of the viewport, but I want the content (i.e. all of the panel-grid-cells) to be constrained to my site’s standard container parameters (width, margin, padding, etc). I need the row to be the full of with of the viewport so I can style it according to my users’ specifications. Here’s the desired output HTML for reference:


<div id="..." class="panel-grid">

  <div class="container">

    <div id="..." class="panel-grid-cell"></div>

    ...

    ...

  </div>

</div>


If anybody could help me with doing that, or point me in the direction of a filer that might better meet my need (and explain it) it would be very much appreciated.
Side question: I’m noticing this ‘premium version’ stuff at the bottom of the page. I work for a large enterprise, and we would be interested in a a paid support contract of some kind. Please let me know where I could find information on this.
Thanks much,
—Dan

URL: http://dev.research.wisc.edu/

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, 5 months ago Iain McCallum
    function before_row(){
      return '<div class="class">';
    }
    add_filter('siteorigin_panels_before_row', 'before_row',  $panels_data['grids'][$gi], $grid_attributes);
    
    function after_row(){
      return '</div>';
    }
    add_filter('siteorigin_panels_after_row', 'after_row',  $panels_data['grids'][$gi], $grid_attributes);
    • 9 years, 5 months ago Iain McCallum

      Oop! Last one wasn’t so good.
      I’m trying to do exactly the same thing.
      This worked:

      function before_row($panels_data, $grid_attributes){
        $returnString = '<div class="' . $grid_attributes[style]['class'] . '">';
        return  $returnString;
      }
      add_filter('siteorigin_panels_before_row', 'before_row', 10, 2);
      
      function after_row(){
        return '</div>';
      }
      add_filter('siteorigin_panels_after_row', 'after_row', 10, 2);

      in the row options the user adds a class that indicated the background color of the full width section. The filter above applies that class to the extra div.
      Hope this helps!

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