Jump to content

how to arrange content in bootstrap grid in ckeditor ?


adrianmak
 Share

Recommended Posts

you could also try using a token like {{column-break}} and then use this function on your body field output:

function columnizeMarkup($markup) {
	if(strpos($markup, '<p>{{column-break}}</p>') == false) return $markup;
    $bodyParts = explode('<p>{{column-break}}</p>', $markup);
    $colClass = 12 / count($bodyParts);
    $columns = '';
    foreach($bodyParts as $col) {
        $columns .= "<div class='col-md-{$colClass}'>$col</div>";
    }
    return '<div class="row">' . $columns . '</div>';
}

 

  • Like 8
Link to comment
Share on other sites

On 11/2/2016 at 6:12 PM, netcarver said:

Is there a pressing reason to mix this level of layout into your content? Would separating the columns into individual textareas and moving the layout details into your templates work better?

the site is supporting responsive layout.  Users will add in-line images in anywhere of the content body. In this case without using grid to layout content in the body field, the final look view in mobile devices may look not properly

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...