ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

nbsp; inserted between list items

July 23, 2014 2:27pm

Subscribe [2]
  • #1 / Jul 23, 2014 2:27pm

    Gernot

    7 posts

    I have a list in the content body of an entry that is receiving

     

    between list items. The body field is textarea, XHTML.

    Attached are two screenshots. The first is the list applied directly to the template and is correct. The second is the list rendered via the body field. In both cases the codes are:

    <ul class="list-group">
        <li class="list-group-item">Cras justo odio</li>
        <li class="list-group-item">Dapibus ac facilisis in</li>
        <li class="list-group-item">Morbi leo risus</li>
        <li class="list-group-item">Porta ac consectetur ac</li>
        <li class="list-group-item">Vestibulum at eros</li>
    </ul>
  • #2 / Jul 28, 2014 12:27pm

    Giraffentoast

    152 posts

    Writing html in a textarea field seems weird to me. Doesnt that conflict with the idea of using a CMS in the first place…? Of not having to deal with markup? (Apart from the fact that structure and content should be separate to remain reusable)

    My advice would be to make this a GRID field and loop through it, or (if you absolutely want to mix content and structure) use a WYSIWYG field. Even declaring it a markdown field instead of xhtml will produce perfectly fine markup iirc.

  • #3 / Jul 28, 2014 1:14pm

    Gernot

    7 posts

    Writing html in a textarea field seems weird to me. Doesnt that conflict with the idea of using a CMS in the first place…? Of not having to deal with markup? (Apart from the fact that structure and content should be separate to remain reusable)

    My advice would be to make this a GRID field and loop through it, or (if you absolutely want to mix content and structure) use a WYSIWYG field. Even declaring it a markdown field instead of xhtml will produce perfectly fine markup iirc.

    Your reply is more condescending, unsolicited opinion then it is a solution. My project’s use case doesn’t relate to this issue which is that this feature should work and it doesn’t. Removing the line breaks renders the list correctly.

  • #4 / Jul 29, 2014 4:06am

    Giraffentoast

    152 posts

    The things I’ve described above could be the reasons for your problem.
    That’s why people usually try to avoid doing it this way.

    Sorry if you found my advices condescending. Just trying to help.

  • #5 / Jul 29, 2014 10:09am

    Rob Allen

    3118 posts

    What EE version are you using?
    Are there any empty spaces after the closing LI elements?

  • #6 / Jul 30, 2014 8:41pm

    Gernot

    7 posts

    v2.9.0 - Build Date: 20140715.

    No whitespace after any elements.

  • #7 / Jul 31, 2014 2:27am

    Rob Allen

    3118 posts

    Hmmm not seen that with 2.9!

    Does it affect all entries that have lists in that field?

    Have you tried manually condensing the tag and saving to see if that solves it:

    <ul><li>...</li><li>...</li><li>...</li></ul>

    If you pasted in the content from elsewhere it is possible that the spaces are being inserted by hidden characters….

  • #8 / Jul 31, 2014 11:24am

    Gernot

    7 posts

    Yes, placing the list on a single line is a workaround as I mention briefly in my reply to Giraffentoast above. I’ve also mentioned that in a bug report.

    I don’t think that hidden characters are being inserted from my end as I have my text editor configured to show all hidden characters as well as remove trailing whitespace.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases