Conver two br tags to p tag and one br tag to just the br tag

Hello,

I'm using the latest zenphoto. I would like to adjust the outputted content in both the album and the image descriptions so that when a person hits return twice, (which yields two br tags), that it turns that block of text into a paragraph and when a person enters one br, then it's a new line. Is this a simple fix?

If not, can I turn off the automatic br and just enter the p tags etc, in the description field. My customer literally adds a ton of text per painting and right now it displays nicely with the br tags, but I'm wondering will the site take a hit SEO wise if there are long, long paragraphs (right now I have the description showing up between a "p" tag)?

Thanks!

Comments

  • acrylian Administrator, Developer
    You could hack the admin to use a rich text editor like TinyMCE (the one Wordpress uses) on the text fields.
    But remember that would be problematic regarding updates.

    I really don't understand what you mean with automatic "br".
  • I've no answer but am curious:

    [div id="imageDesc" style="display: block;"] was what I saw for my Sized image description. Not sure how you got [p] tags or even [br] tags. What do you mean by "automatic br" out of curiosity. Some of my descriiptions are rather long and multiple paragraphs. Each as a empty line between to clearly indicate new paragraph (two returns)

    I'm running build 1497
  • Thanks. The default system is that when a return is hit twice, it creates a br tag twice, if it's one return, the text goes to the next line. What I want is just paragraphs (two br tags fake that). I'll look into TinyMCE.
  • Yes, it's default HTML code but if you do a view source you'll not see any P or BR tags in your description.
  • acrylian Administrator, Developer
    Exactly, zenphoto does not enter anything to the text in the description field if you use the admin backend.

    It may be the case that your browser adds something to the field if you use the ajax-on-the-fly-editing. I am not familiar with those parts of the code. It may be the brower which adds something. In that case try the backend.
  • acrylian wrote...

    You could hack the admin to use a rich text editor like TinyMCE (the one Wordpress uses) on the text fields.

    Is that a complicated thing to do? ..or is it possible even for somebody that have only little knowledge in php? ..like me ;)
  • acrylian Administrator, Developer
    Not at all, all you have to do is to download the Zenpage package and just install the included second plugin "tinymce" and activate it (Zenpage itself is not required). This enables tinymce on the backend.
  • Linefeeds in descriptions are converted to tags by the printImageDesc(() function. If you wish to change the output of the image description it would need to be filtered before being printed. This could happen either in the backend in an editor as acrylian suggests or in you theme when the field is printed.

    If you download and install the zenpage plugin it will provide the tinyMCE editor which will then be used for editing descriptions in the backend. No need to enable the zenpage plugin for this to happen.
Sign In or Register to comment.