Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter NickA55

    (@nicka55)

    Just wanted to update with some more info…

    If I change this line:
    $output_buffer .= “<div class=\”description\”>” . $dog->description . “</div>

    To this:
    $output_buffer .= “<div class=\”description\”><textarea>” . $dog->description . “</textarea></div>

    It works, but positions the text area below the pictures. And a TextArea is not ideal for this situation. I used a
    pre tag and that worked but loses the formatting.

    Also, a div tag is added before the description. Is that a WordPress thing?

    At any rate, any help would be appreciated.

    Plugin Author bridgetwes

    (@bridgetwes)

    Last I knew, Petfinder was stripping out formatting on their end. You can see what Petfinder is returning by uncommenting line 231 in the plugin. It should say print_r($xml). After you uncomment this line (remove // before line), view your petfinder page on your site and it will have everything petfinder is returning at the top. You want to look for a description tag.

    <textarea> is a tag to display a form input, not for formatting, so it is not going to help.

    Thread Starter NickA55

    (@nicka55)

    Adding a TextArea did format the text properly. It had our paragraphs separated and looked just like it does on the petfinder site. When I say formatting I don’t mean bold, fonts, colors, etc. I mean paragraphs.

    For some reason the div class=”description” does not recognize CrLf (carriage return, line feed).

    So basically, adding a textarea or pre tag surrounding $dog->Description works. Something is making the text ignore new lines. It just wraps all the text.

    Here’s an example of what I mean…

    This is line one

    This is line two.

    It shows like this:

    This is line one
    This is line two.

    If I wrap it in a TextArea or Pre tag it works, but of course that’s not an ideal solution.

    Plugin Author bridgetwes

    (@bridgetwes)

    HTML does not recognize CrLf. To display as paragraphs, you would have to put paragraph tags “<p>” around your content in the correct places. Textareas do recognize CrLf, but they are not appropriate to use in this context. They are for use in forms, not in displayed text. You should have an input textbox around your content if you use a textarea tag. I can’t add paragraph tags to the plugin because it could mess up the description display on other people’s sites.

    Thread Starter NickA55

    (@nicka55)

    Ok, thanks. I will keep messing with it and see what I can come up with. The first paragraph in our description is for sponsors, so we like to keep that separate from the rest of the text.

    Great plugin by the way. I actually bought a theme that had PetFinder integration, but we don’t use the integration at all. We liked your plugin better for the PetFinder stuff ??

    Thread Starter NickA55

    (@nicka55)

    Here’s the solution. The problem is the plugin doesn’t handle white space. Well, the way the plugin formats the HTML doesn’t I should say.

    I wrapped dog->description with a pre tag like this:

    <pre style=’white-space: pre-wrap; font-family:arial;’>

    I will set all of that to a class instead of using an inline style, but it works great.

    Hope this helps out other users. White space in the description is very important. It makes it more readable, and logically separates the details of the description.

    Plugin Author bridgetwes

    (@bridgetwes)

    Good workaround. Petfinder has been a moving target on descriptions. They used to allow you to put HTML in the description box, then they made the description box a WYSIWYG which added formatting just like WordPress does when editing a page. Now they don’t have a WYSIWYG and they strip out any HTML tags you try to add in the description field, except for links, as far as I can tell. Looks like they replace returns with two
    tags to make paragraphs in the description on Petfinder’s site.

    I’m glad you found the plugin easy to use otherwise.

    Thread Starter NickA55

    (@nicka55)

    It’s a great plugin. I’m not sure how much I’m allowed to edit the plugin to suit my needs, but I’m working on a two column layout. Also working on a compact pet listing page, and clicking on a pet brings you to a detail page. Also trying to get the images into a lightbox slide show.

    Marking this topic as resolved… Thanks again for writing this plugin.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Paragraphs In Description’ is closed to new replies.