extra <br> tags

hi, my problem is that there are extra tags added to the zen pages when viewed... they do not appear in the html source in the administration area.. but when i view the page through view source they are there after each

li and <p> and i dont want them there.. how do i fix this

Comments

  • acrylian Administrator, Developer
    You need to be a little more specific. Where is that added?
  • sorry, i see the text hasnt come out properly either.. there are extra break tags after all the paragraph and li tags
  • acrylian Administrator, Developer
    I still do not understand where that is added. Within the content of a Zenpage page or a Zenphoto page or where?

    Also please what Zenphoto release do you use and maybe post a link so we can look at it.
  • http://203.98.75.55/~icehawkc/insulated-pantecs/ - the gallery description, if you view source you will see all the extra break tags, these do not appear in the html source
    the version is Zenphoto version 1.2.5 [4022] (Official Build)
  • acrylian Administrator, Developer
    The are inserted by the TinyMCE editor if you use the ENTER key. Once before it was setup to automatically generate <p> but that was skipped because it lead to invalid HTML when a <p> was already surrounding the text as it is in standard themes.

    This can of course be configured differently. TinyMCE's configuration (for the Gallery, Zenpage has a separate one) is in `zp-core/js/editor_config.js.php`. You will find all configuration options here: http://wiki.moxiecode.com/index.php/TinyMCE:Configuration
    You will have disable this option: http://wiki.moxiecode.com/index.php/TinyMCE:Configuration/force_br_newlines
  • I ran into this problem myself. I set force_br_newlines to false and forced_root_block to false and I'm still getting these annoying br tags. I thought it might have something to do with caching, so I cleared both my browser and Zen Photo and logged out/in of the admin. No dice. The br tags are not just being inserted during new lines — if I go into the html editor and type <div><p></p></div>, the editor is breaking them out onto new lines on its own.

    I would love some info on how to fix this, if anyone has any. For now I'm fixing it through CSS.
  • Have you tried the nightly build? Zenphoto was converting line breaks to BR tags in some cases. We have changed that so it only occurs if TinyMCE is not enabled.
  • No, I'm using 1.2.6. However, I'm not sure if what's happening to me is problem you're referring to. As I wrote, even when I don't put in a hard return, TinyMCE still seems to be inserting br tags.

    I've noticed nightly builds mentioned in other threads — is the expectation for users to use nightly builds instead of official stable releases? I'm not used to do things that way, but if that's the better way to go, I will do that.
  • acrylian Administrator, Developer
    That is the issue. TinyMCE inserts instead of <p> because most themes put the image/album description already within a <p> element so this would lead to invalidation. As said you can configure TinyMCE to your own liking.

    Well, the nightly build is the developement version that will become the next official one. If you encounter issues in an official version it is of course fixed in the developement version. By testing if the nightly fixes your issue that you help us to eliminate any further bugs.
  • I'm not sure you understood what I wrote. To clarify:

    If I write:

    `

    `

    on a single line, TinyMCE does this:

    `


    `

    I have set `force_br_newlines` to false and `forced_root_block` to false in `zp-core/js/editor_config.js.php`. Not sure if that even matters, however, because there are no new lines to convert — it's all one line.

    But it's neither here nor there — I fixed the issue through CSS by setting the br tag to `display:none`. It would be nice if br tags were not injected to begin with — Zenphoto is hardly an application that is useable out of the box by a novice so it doesn't make a lot of sense to "dumb down" this aspect of the text editor — especially when there is an html mode that gives the appearance of control over the html. It would make more sense to have `force_br_newlines` off by default and allow it to be activated by users who need it.

    Just my $0.02.

    Anyway, thanks for the help and fast replies. Zenphoto is a great piece of software. Thanks!
  • It is tinyMCE that is doign this? If so, the problem will need to be addressed by them.
  • Well, I don't know. Earlier in this thread acrylian brought up TinyMCE, so that's what I assumed was the issue. I'm just mentioning that I followed his instructions to turn off br tags, but it didn't work.
  • acrylian Administrator, Developer
    As said before please try the nightly. The extra tags are added on display on the theme side by the on-the-fly-js editing function, they are not added for real to the text. Configuring TinyMCE alone does not help if you are on 1.2.6.
  • i am still having this trouble, i upgraded to latest build but that didnt work.. so you are suggesting that we download a nightly build version and hope there are no bugs? everyone using this must have the same problem? i now also have the problem of this text "ablum description here" appearing on all of the albums although this text does not appear in admin or database
  • whoops found the album text problem... if only i could get rid of these extra tags..doh
  • acrylian Administrator, Developer
    Well, the nightly has this issue fixed and will become 1.2.7 in the future. If you can't wait you have to try the nightly (and also help us to find other bugs by doing that) or you will have to wait until 1.2.7 is released.
  • Hi, I was having this problem, upgraded using the nightly build 11_16, which fixed the extra br problem, but now I have no tinymce editor on by edit album and edit image pages.

    Does anyone have any idea why this might be happening?

    I might be barking up the wrong tree, but it looks like the javascript is not being called on admin-edit.php when editing an album/image.

    Thanks for any help!
  • I am seeing the TinyMce editor for albums. Are you getting Javascript errors?
  • no there aren't any errors at all, just no editor
  • acrylian Administrator, Developer
    TinyMCE is an option in the nightly (options -> gallery tab). Maybe that is not enabled (should be by default actually).
  • I can't believe I didn't notice that and spent so long trying to figure it out too! It wasn't checked by default and I hadn't realised it was there...

    Thanks so much acrylian and sbillard for your replies and help.
  • arvidtp Member
    sorry to revive an old thread, but for some reason I'm having this problem again with 1.4.0.4. tinymce appears to be working fine and creating the correct html, but extra br tags are getting stuck at each return if i use `printAlbumDesc(true);` to print my album descriptions. It's a template I developed on an older version of zenphoto (1.3.1) so there might be something wrong with it, but I can't find anything. I have Front-End Editing turned off.

    For now I'm getting around the problem by using echo `(getAlbumDesc());` to print the descriptions instead. That works fine.
  • acrylian Administrator, Developer
    If front end editing is disabled you should use `printAlbumDesc(false)` (that is actually default if nothing is set) as the `true` enables the frontend editing stuff.

    If TinyMCE generates the right html there is no other way that this might be changed.
Sign In or Register to comment.