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.

EE adding unwanted <p> </p> tags around weblog custom field entry

December 07, 2008 5:31pm

Subscribe [4]
  • #1 / Dec 07, 2008 5:31pm

    mnewing

    8 posts

    I want to create a weblog custom field that allows the user to enter part of a file name which i use to build the full name. BUT EE in its wisdom is adding a paragraph tag around it which means that i cannot build a file name from it. Is there some easy way in EE to strip off the   tags or even better some way to stop EE doing this in the first place.

    here is the relevant part of my template code:
    ————————————

    <h1>Testing images</h1>
    {exp:weblog:entries weblog="bikes"}
      Image {photo}
      image path is /images/bikes/{photo}TN.jpg
    {/exp:weblog:entries}

    and here is the generated html
    ————————————

    <h1>Testing images</h1>
    
      Image chevron
    
      image path is /images/bikes/chevron
    
    TN.jpg
  • #2 / Dec 07, 2008 6:13pm

    silenz

    1651 posts

    Have you set the Default Text Formatting for the {photo} field to None when you created the field? If not, you should do it now.

  • #3 / Dec 07, 2008 6:24pm

    mnewing

    8 posts

    i am afraid i did that when i created the custom field :(. i have just checked and it is set to none and the formating menu is hidden

  • #4 / Dec 07, 2008 6:24pm

    mnewing

    8 posts

    the field type is “text input” with a max of 50.

  • #5 / Dec 08, 2008 6:25am

    mnewing

    8 posts

    i have an updated as i have now solved this issue.

    I did the following
    1. Custom field settings and change the default text formating from “None” to “XHtml” and checked the box to update all current entries and saved my settings.

    2. Viewed my site and still have the unwanted   tags as expected

    3. Custom field settings and change the default text formating from “XHtml” to “None” and checked the box to update all current entries and saved my settings.

    4. Viewed my site and hey presto no longer have a   tag around the value.

    thanks to anybody who tried to assist me with this one.

  • #6 / Dec 08, 2008 7:05am

    Ingmar

    29245 posts

    Yes, it was clearly a question of field formatting, and setting it to “None”, even on existing entries. Glad you solved it.

  • #7 / Dec 08, 2008 7:08am

    mnewing

    8 posts

    But it is slightly odd that when i created the field with the setting of none in the first place it was ignored and i had to toggle the settings round completely to get it to work. That would catch most folks out i think and feels like a bug.

    but anyhow i have solved it so i can get on with my site.

  • #8 / Sep 20, 2009 2:56am

    J.B.

    79 posts

    You wouldn’t have happend to create the entry with a SAEF not using the custom_fields tag?
    If so see the Nov 2008 comment on the
    SAEF User Guide about a new requirement for post 1.6.5 version needing the field_ft_# set via a hidden field.

    Had a similar problem and that turned out to be my issue.  values are none, br, xhtml by default.

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

ExpressionEngine News!

#eecms, #events, #releases