• Resolved readwriteandedit

    (@readwriteandedit)


    Great plugin, Jeroen. Thanks for making it so simple.

    I have a request–can you change the setup to automatically add paragraph breaks to the description? I know that I can do that manually, but hitting Enter for a paragraph break would be a lot faster than typing the code each time I need it. (I sometimes have several items within one listing and they can be difficult to read if the new items don’t begin on a new line.)

    The site is still under construction, but here’s a link to the preview of one page–Big List. I manually added paragraph breaks to the first listing, for crayons. In the next two listings, you can see how the lists of the different colleges are difficult to read because I didn’t manually add paragraph breaks.

    Thanks for your consideration. (I have another question, but I’ll start a new thread for that one later.)

    https://www.ads-software.com/plugins/name-directory/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Jeroen Peters

    (@jeroenpeters1986)

    Hi readwriteandedit,

    the link doesn’t work at the moment, probably because I am not logged in. So I can’t really see what the situation is at the moment.

    Have you considered using CSS to style the elements?
    Every ‘name’ (entry) has a class which makes it easy to style.

    I think this will help you further:

    <style>
    .name_directory_name_box {
       margin-bottom: 1em;
    }
    </style>

    There are two advantages to this approach:
    – You can also specify the margins as pixels so it can be exactly as you like
    – If you want to modify the spacing (or remove it), you only have to edit this one stylerule and not every entry in the plugin ??

    Will this also be of help?

    Thread Starter readwriteandedit

    (@readwriteandedit)

    Hmm… I’m not sure why that particular approach would help this situation, that of adding line or paragraph breaks to the description output, though I like the idea of using CSS to style this so I can manage the styling through my child theme.

    It was my fault that you couldn’t see the link for the Big List–the page is now public. Could you take another look, check out the differences between the text in the first listing (Crayola Crayons)–where I added paragraph breaks through html–and the other listings, where the text simply runs together? Just as you and I both created paragraph breaks here in our comments so the text doesn’t run together in a single paragraph, I want to do that with the text in my glossary descriptions. If I can do that through CSS, that would be great, but reading up on line and paragraph breaks in textareas, it seems to have something to do with strings and the nl2br() function, and I admit that I have no idea what to do with something like that. (If I can add code to my child functions.php, I’d be happy to do so. I just don’t know what the code would be.)

    Thanks again for your help.

    Plugin Author Jeroen Peters

    (@jeroenpeters1986)

    Ah, now I see what you are getting at! I thought you wanted a paragraph between every entry ??

    Yes, a functionality like this could be implemented with the nl2br() function.

    If you’d like you can edit shortcode.php and try to search for html_entity_decode(stripslashes($entry['description'])).

    I hope it will work if you change it to: nl2br(html_entity_decode(stripslashes($entry['description'])))

    If it works I might add it to a configurable option in a feature release, but I can’t promise that at the moment. It would be a feature thats difficult to explain (but it is in line with the WordPress editor).

    Anyway, I hope this will work for you

    Thread Starter readwriteandedit

    (@readwriteandedit)

    You are awesome–that was the perfect fix. Thank you very much. You saved me a lot of extra typing.

    Plugin Author Jeroen Peters

    (@jeroenpeters1986)

    Nice to hear! I checked the website and it looks good ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Add Paragraph Break Within a Description’ is closed to new replies.