documentation

Changing the HTML Output

Changing the HTML Output

The HTML output of Section, Rows, and Columns can be changed to work with your own framework. There are 2 data attributes that must be present in each of the template files. To override these template files, simply copy the templates folder from the Plato Pages plugin and paste into the folder of your current theme and rename to "plato".

The data-plato-section attribute

This attribute must be on the outermost HTML tag of the section, row, and column template. The value must be the same as the template type (section, row, column).

// content-section.php
<div data-plato-section="section" class="<?php echo apply_filters('plate_content_section_default_classes', $plato_global['class']); ?>"> // removed inner html for clarity </div> // content-row.php
<div data-plato-section="row" class="<?php echo apply_filters('plate_content_row_default_classes', $plato_global['class']); ?>"> // removed inner html for clarity </div> // content-column.php
<div data-plato-section="column" class="<?php echo apply_filters('plate_content_column_default_classes', $plato_global['class']); ?>"> // removed inner html for clarity </div>

The data-plato-content attribute

The data-plato-content can either live on the same level as data-plato-section or inside the data-plato-section container. This attributes lets the plugin know where to append the incoming content.

// content-section.php
<div data-plato-content="rows"> // where the content-row.php will be appended.
<?php echo do_shortcode($plato_global['content']); ?>
</div>

// content-row.php
<div data-plato-content="columns"> // where the content-column.php will be appended
<?php echo do_shortcode($plato_global['content']); ?>
</div>

// content-column.php
<div data-plato-content> // no value needed. This is where the final content will live.
<?php echo do_shortcode($plato_global['content']); ?>
</div>