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.

Removing p tags with XHTML formatting

August 17, 2011 4:26am

Subscribe [2]
  • #1 / Aug 17, 2011 4:26am

    eclectiv

    133 posts

    Is there a way to remove p tags from images I upload into an XHTML formatted field?  I’m trying to create an easy way for my client to upload images and add a class that either floats the image left or right in the body of the text.  However, the images keep getting wrapped with p tags and is throwing off the layout.

  • #2 / Aug 17, 2011 7:12pm

    Dan Decker

    7338 posts

    Hi there eclectiv,

    You can set the field’s formatting to “None”. To do this, in the ExpressionEngine Control Panel, navigate to Admin-> Channel Administration-> Channel Fields. Then click the Group Name and Field Name for your field. Set the dropdown near “Default Text Formatting for This Field” to “None” and update the Field Settings.

    “XHTML” will automatically wrap text field values in tags. In textarea fields, it changes single line-breaks in to
    tags and double line-breaks in to tags. “None” leaves all the HTML formatting for fields up to you.

    Hope this helps.

    Cheers,

  • #3 / Aug 17, 2011 7:26pm

    eclectiv

    133 posts

    Hi Dan,

    I should have prefaced this earlier.  I know you can change the formatting to the text field, but this means that my client will have to wrap paragraph tags around all the text paragraphs—which can be fairly painful and cumbersome for the client.  Any way to get around this?  A plugin, etc.?

  • #4 / Aug 19, 2011 9:45pm

    Dan Decker

    7338 posts

    eclectiv,

    Just so I’m clear on this, you are inserting this image into textarea field? What version of ExpressionEngine are you using?  I would like to try to replicate this issue to get a handle on what’s happening. I don’t think that EE should be wrapping any html tags with tags as part of XHTML formatting. For example, if you were using <h1> tags, it should ignore those. Also if you could post a screen shot of the field, with an example entry, from your publish page. Just to give me an idea of what we’re dealing with here.

    Cheers,

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

ExpressionEngine News!

#eecms, #events, #releases