How to display post contents in a list in a way respecting the paragraphs?

Support MB Views How to display post contents in a list in a way respecting the paragraphs?Resolved

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #45999
    EddyPiVEddyPiV
    Participant

    Hi,

    I have a View showing posts of a category, and for each post the title and the contents are displayed.
    Posts are created in the classic visual editor by users not familiar with html.

    Two questions:
    1. Is there a way to limit the displayed contents for each post to say 50 words and a "Read more" link?
    2. Although the posts have multiple paragraphs, in the view results the contents of each post is displayed all on 1-2 lines, everything right after each other. Is there a way that the view results respect the paragraphs?

    #46008
    PeterPeter
    Moderator

    Hello Eddy,

    1. This is basically a custom code. You can follow this topic to create read more button and limit words of a content with JavaScript code
    https://stackoverflow.com/questions/23170581/text-in-div-limited-characters-add-read-more-link-and-show-all-characters-whe

    2. Can you share some screenshots of the post content in the admin area and frontend? Do the paragraphs have <p> tags if you switch to the tab Text of the editor?

    #46015
    EddyPiVEddyPiV
    Participant

    Thanks Peter for sharing this link re the first point.

    Re point 2: No, there are no <p> and </p>'s. I know that this will result in proper showing, but the users are 'simple minds' and I don't want to bother with adding this to their text. So they just enter the text in the (classic) Visual editor.
    But now it shows as a concatenation of words, all on 1-2 lines.

    For this case I'll fall back to the display-posts plugin that handles it out of the box and also respects <!--more-->.

    Thanks for your help.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.