Jump to content


This topic is now archived and is closed to further replies.


Output linebreaks

Recommended Posts


In a custom section I have a textarea option. When I enter some text in the textarea and do some linebreaks, I see them in the DMS editor, but they are gone on the output.


How do I keep these linebreaks on the output? I have now:

function section_template() {
    printf( '
            <div class="row">
                <div class="span4">%1$s</div>
                <div class="span6"><p>%2$s</p></div>
            $this->opt( 'my_text' ), // This my textarea 

Share this post

Link to post
Share on other sites



Can you add your whole custom sections code (full section.php file) to your reply, so I can try myself please.


Also, try viewing our developer docs which has information on how to add text areas etc. - http://docs.pagelines.com/developer/dms-option-engine


Like so:


$opts[] = array(
            'key'           => 'some_key',
            'type'          => 'textarea', 

Please search our forums, before posting!

Share this post

Link to post
Share on other sites

Here it is:

Section: Sub Header
Author: Blue Cloud
Author URI: http://www.bluecloudcompany.com
Description: Een subheader met daarin een menu en een tekstblok
Version: 1.0.0
Class Name: EGS_SubHeader
Filter: Component

class EGS_SubHeader extends PageLinesSection {

    function section_persistent() {

        // Put code that should always be loaded here.
        $url = $this->base_url; // the base url of the section
        $dir = $this->base_dir; // the base directory of the section


    function section_opts() {

        $opts = array(
            array (
                'key'           => 'subheader_menu',
                'type'          => 'select_menu',
                'title'         => __('Sub Menu', 'erfgoedspoor'),
                'label'			=> __( 'Selecteer menu', 'erfgoedspoor' )
				'key'			=> 'subheader_title',
				'type'			=> 'text',
                'title'         => __( 'Titel', 'erfgoedspoor'),
				'label'			=> __( 'Titel in de Sub Header', 'erfgoedspoor' ),
				'key'			=> 'subheader_text',
				'type'			=> 'textarea',
                'title'         => __( 'Tekstblok', 'erfgoedspoor'),
				'label'			=> __( 'Tekst in de Sub Header', 'erfgoedspoor' ),
        return $opts;


    function section_styles() {


    function section_head(){

        // This will out put in between your sites <head> tags.
        // For example, adding javascript:
            jQuery(window).ready(function() {
                // Javascript could go here.


    function section_template() {

        printf( '
            <div class="row">
                <div class="span4">%3$s</div>
                <div class="span6 subheader-text"><h5>%2$s</h5><p>%1$s</p></div>
            $this->opt( 'subheader_text' ),
            $this->opt( 'subheader_title' ),


     * Build the menu
     * @return string
    private function build_menu( ) {

        $menu = $this->opt( 'subheader_menu');
        $menu_list = '';
        $menu_items = wp_get_nav_menu_items( $menu );

        $menu_list .= '<ul class="subheader-menu unstyled">';

        foreach( (array)$menu_items as $menu_item ) {

            $title = $menu_item->title;
            $url = $menu_item->url;
            $menu_list .= '<li><a class="" href="'.$url.'">' . $title . '</a></li>';


        $menu_list .= '</ul>';

        return $menu_list;


Share this post

Link to post
Share on other sites

  • Similar Content

    • cstudio
      By cstudio
      I need some help!  I am trying to add a Square booking script.  When I add it to a embed section it crashes the page editor and I am unable to save the page version.  I have tried using different browsers with the same result.
       I can add the script on the backend in the word press content area and get it to show and work, but it look terrible.  A page with in a page.  http://www.zoeanastacia.com/booking/.
      I need help getting the page editor to work properly or to make the wp content section to not look like an 90's iframe.
    • oseehys
      By oseehys+
      Hello There,
      So i want to use platform 5 and DMS sections on a single page, i am using a child theme with pinspro as my main theme and i activated platform 5, the only problem am having so far is the fixed option, my navbars are not aligning to their default size, and it will be great if platform 5 header and footer section will function, has anyone used this option, how can i make the best use of platform 5 and DMS on a site
    • yemoonyah
      By yemoonyah+
      I tried to make a simple change on my opt-in page today by reordering two sections.
      Now they won't save and whatever I do, the same 2 section will be stuck to the top.
      This is a huge problem since it is my opt-in page!
      (I'm on the latest WP & PL version)
    • Anthony King
      By Anthony King+
      I have to say that I like the Layout and the Template based sections. Some of them are really impressive.
      One of the things that I would like to request though is the possibility of being able to dynamically rearrange the layout.
      An example of what I am talking about is take the Agency Section. It's current layout starts with the
      Splash Module then the Portfolio Module then the Service Module and so on and so forth.
      What would be great is if we were able to move these modules around. I.e have the Service Module first
      then maybe the Splash, and then the portfolio.
    • nandorj78
      By nandorj78+
      This discussion has appeared today on the Facebook User Group and we decided to have a vote to know what the users judge more important.
      Let me know which questions you want me to add to the poll.