Home / Forums / DynamiX Support / Styledbox showing paragraphs but not break lines

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts

  • Pavel
    Participant

    Hi, I am using styledbox shortcode and paragraphs are shown (transformed to HTML tags) and break lines not. There is remove_wpautop() function which should remove both? Is there any chance to show break lines from WordPress editor when using styledbox shortcode? Thank you very much!

    Andy
    Andy
    Keymaster

    Hi Pavel,

    I’ve changed this for the next version, however if you want to change it yourself, follow the guide below.

    Editing DynamiX/lib/adm/inc/map.php

    Search for the line:

    $output .= "\n\t\t".'<div class="boxcontent clearfix '. $inner_type .'" '. $inner_style .'>'. remove_wpautop($content) .'</div>';

    Change to:

    $output .= "\n\t\t".'<div class="boxcontent clearfix '. $inner_type .'" '. $inner_style .'>'. do_shortcode($content) .'</div>';


    Pavel
    Participant

    Works great, thank you very much!

    Andy
    Andy
    Keymaster

    You’re welcome!


    Pavel
    Participant

    After upgrading to 3.1, original problem is back 🙁

    Andy
    Andy
    Keymaster

    Hi Pavel,

    I’ve stopped using the map.php file now, the maps are placed individually within each shortcode file, e.g. DynamiX/lib/inc/shortcodes/styled-boxes.php

    The code has do_shortcode($content) – so I’m not sure why it’s not working. What styledbox is it, there is the older shortcode method that has the remove_wpautop($content) method, you could try changing them to, within the styled-boxes.php file?


    Pavel
    Participant

    There is following shortcode used in a page: styledbox type="general"

    But even if I tried to make new Styledbox with Visual Composer (inside with Text Block) and used breaking lines, they are not displayed. Paragraphs are OK in HTML, but break lines does not work…


    Tom ( Support)
    Keymaster

    Hi Pavel,

    We have tested this and if you do a single carriage return it puts the text underneath as it should. Is this the problem you are having?

    Kind regards,
    Tom


    Pavel
    Participant

    Yes, when you use break line in editor (Shift + ENTER), then it works in editor. But on website, there is no break line (br) HTML element, only paragraphs.


    Tom ( Support)
    Keymaster

    Hi Pavel,

    By the looks of things, the br tags work but shift+enter no longer works in visual composer. If you hit enter instead of shift+enter it drops it on another line with a space in-between within VC but on the front end it appears how you want it to look, on a new line with no space. If you want to have the look of a new paragraph on the front end, you will need to hit enter twice within VC.

    Hope this makes sense.

    Kind regards,
    Tom


    Pavel
    Participant

    Sorry, but it does not make sense for me…

    In Visual composer works Enter and also Shift + Enter, I can see it when I switch to HTML editor. You can test it:

    1) Insert Styled Box into editor.
    2) Insert Text Block into Styled Box (I did not find any other way to insert text into Styled Box).
    3) Insert following text into HTML editor:

    First paragraph
    - first new line (Shift + Enter)

    Second paragraph (Enter)
    - second new line (Shift + Enter)

    It looks nice in Editor and Visual composer, but on website there are no new lines and no breaks. There are only two paragraphs.

    And big problem is also with back comaptibility. We have really many old Styled boxes and everything worked well in 3.0.x, but with 3.1 there is old problem (ignoring break lines).

    Thank you for your help…


    Tom ( Support)
    Keymaster

    Hi Pavel,

    It is just something that Visual Composer seems to have added. If you Shift + Enter twice it produces the space you are after.

    We will ask Visual Composer about this though. Does it just do it in a styled box or just in text block too?>? Test this out for me also.

    Kind regards,
    Tom


    Pavel
    Participant

    Hi,

    I do not think, that it is related to Visual Composer.
    Problem is also visible when there is no Visual Composer used (only shortcode in Classic editor).
    It worked fine until there was change in latest release (Andy wrote that there is no more map.php used).
    If I use Shift + Enter twice, then there is new paragraph and not only break line.
    Text Block is fine and everything works well as expected, problem is only with Styled Box.

    Thank you for your help!


    Tom ( Support)
    Keymaster

    Hi Pavel,

    Try updating the following file to see if this resolves your problem.

    DynamiX/lib/inc/shortcodes/styled-boxes.php

    http://help.themeva.com/tmp/styled-boxes.php.zip

    Kind regards,
    Tom


    Pavel
    Participant

    Awesome! Thank you, it works!

    Yes, as I can see, there were some others remove_wpautop() calls which were replaced by do_shortcode(). Now it works well with older Styled boxes and also the new ones from Visual composer. Nice!

Viewing 15 posts - 1 through 15 (of 16 total)

You must be logged in to reply to this topic.