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.

SAEF preview adds <p> to my custom fields

October 30, 2007 6:23pm

Subscribe [4]
  • #1 / Oct 30, 2007 6:23pm

    Oliver Wood

    6 posts

    I’ve built a SAEF where my client can upload delivery info for his haulage business. When I try to preview an entry, any custom fields between {preview} tags are wrapped in tags.
    The following code:

    {exp:weblog:entry_form weblog="growers" return="growers/index" preview="growers/brown"}
    {preview}
    Please check the following information is correct before hitting submit.
    <h2>{title}</h2>
    
    <p><ul><br />
    <li>Delivery Note:{del_note}</li><br />
    <li>Customer: {up_customer}</li><br />
    <li>Delivery Reference: {up_del_ref}</li><br />
    <li>Grower Reference: {up_grower_ref}</li><br />
    <li>Product: {up_product}</li><br />
    <li>Product Reference: {up_product_ref}</li><br />
    <li>Quantity: {up_quantity}</li><br />
    <li>Field /Store Reference: {up_fieldstore_ref}</li><br />
    <li>Haulier: {up_haul}</li><br />
    <li>Trailer Number: {up_trailer}</li><br />
    </ul><br />
    ....<br />
    {/preview}

    renders as:

    <ul>
    <li>Del Note:1</li>
    <li>Customer: 45</li>
    <li>Delivery Reference: 1445APB</li>
    <li>Grower Reference: GMRR5</li>
    <li>Product: Carrots</li>
    <li>Product Reference: EEWR45</li>
    <li>Quantity: 2000kg</li>
    <li>Field /Store Reference: HAM</li>
    <li>Haulier: PPK</li>
    <li>Trailer Number: AK528LP</li>
    </ul>

    Default text formatting on each custom field is set to ‘None’ in the Admin panel. If I try to output the same info inside {exp:weblog:entries} tags the info displays as it should; ie no tags within my <li>s. Has anyone had the same problem or am I just doing something I shouldn’t? I’m running 1.6, build 20070815.

    Many Thanks

    - Jamie

  • #2 / Oct 30, 2007 8:13pm

    Sue Crocker

    26054 posts

    Jamie, you’re a build behind, but I don’t think that is what is causing your problem.

    There is a workaround, you could use the Find and Replace Plugin to get rid the paragraph markings.

    This is the first time I’ve seen someone use an unordered list to fill out the preview.

  • #3 / Oct 31, 2007 4:38am

    Oliver Wood

    6 posts

    Thanks Sue, I’ll give the plugin a try. Since the weblog is basically a large order form, outputting the preview via a <ul> seemed the best choice given the data, but maybe I’ll rethink.

    - J

  • #4 / Jun 29, 2008 11:18pm

    grantmx

    1439 posts

    I am having this same exact problem, but when I use the find and replace plug-in, it appears to parse before the {preview} tag spits out the text and code, thus doesn’t find the paragraph tags.  The weird thing is that I have the formatting for my custom field set as “none”, yet it still wraps it in tags.

  • #5 / Jun 30, 2008 10:30am

    Robin Sowell

    13255 posts

    Took a look at the code and preview should conform to the specified format.  What build/version are you running?  And can you paste the relevant bits of the preview tag pair?

  • #6 / Jun 30, 2008 10:41am

    grantmx

    1439 posts

    Running build: 20080626 - Version 1.6.4

    Here is my tag code:

    {exp:weblog:entry_form weblog="book" return="book/index" preview="book/preview"}
        {preview}
            <h1>{title}, {b_location}</h1>
            {b_body}
        {/preview}
    <input type="image" src="{site_url}assets/back-saef.jpg" value="Back" >
    {/exp:weblog:entry_form}

    And her is what it spits out:

    <form stuff>
    <h1>Administrator, Atlanta, GA
    </h1> 
    Body stuff formatted correctly
    <input type="image" src="http://boone60th.org/assets/back-saef.jpg" value="Back" >
    </form>

    I also should note, that even if I use {display_custom_fields} inside the {preview} tag pair, it still wraps them with the tags.

  • #7 / Jun 30, 2008 11:25am

    Robin Sowell

    13255 posts

    Odd- I’m not replicating.  Running 1.6.4

    I checked my custom field formatting was set to ‘none’- just put in a title and one custom field.  Outputs:

    <h1>Second test the preview</h1>
    
    La la la.
    
    No formating.  There was a space above this!

    Preview code looked like:

    {preview}
    <h1>{title}</h1>
    
    {display_custom_fields}
    
    {/preview}

    I’d swear I’ve actually run into this before, but it was on an old version.

    Hm- you definitely have the default field formatting set to ‘none’?  And if you go ahead and enter via the form, when you go to edit, is the field still set to none?

  • #8 / Jun 30, 2008 12:09pm

    grantmx

    1439 posts

    Yep, the default formatting is set to ‘none’ and when I got to the newly submitted entry in Edit it is still set to ‘none’. 

    To add to the weirdness, when I then publish the entry on a template, the custom field, under that entry, has no formatting.  It appears to only give formatting under the {preview} tag pair.  Outside of that it works, “just find and dandy, Thank you” as Forest Gump would say.

  • #9 / Jun 30, 2008 12:37pm

    Robin Sowell

    13255 posts

    OK- do a reveal code on the form- looks to me like if field_fmt_x isn’t passed, it defaults to xhtml.

    So- I look at my revealed code and see:

    <input type="hidden" name="field_ft_13" value="none" />
    <input type="hidden" name="field_ft_14" value="none" />
    <input type="hidden" name="field_ft_33" value="xhtml" />
    <input type="hidden" name="field_ft_62" value="none" />
    <input type="hidden" name="field_ft_64" value="xhtml" />

    It’s right up there at the beginning of the form.  Do a quick search on the form- are the fields coming back w/p tags given a value for field_ft_x?

    That make sense?

  • #10 / Jun 30, 2008 12:52pm

    grantmx

    1439 posts

    Oh, I see.  Is this in my SAEF or somewhere else?  The only problem is that I want to pre-populate the special field names with some of the logged-in users info.  Here is my SAEF form.

    <input type="text" name="title" value="{screen_name}" class="input" value="none" />
    <input type="text" name="field_id_7" value="{location}" class="input" value="none" />
    <textarea name="field_id_5" class="tinput"></textarea>
  • #11 / Jun 30, 2008 1:00pm

    grantmx

    1439 posts

    Looking at the source code on the Pulbish Form field_id_7, which I believe is the problematic field, has no value. 

    <input  dir='ltr'  style='width:100%' type='text' name='field_id_7' id='field_id_7' value='' size='50' maxlength='128' class='input'  />

    Is this what you mean?

    The other custom field has value=“xhtml”

    <input type='hidden' name='field_ft_5' value='xhtml' />
  • #12 / Jun 30, 2008 1:58pm

    Robin Sowell

    13255 posts

    Hm- yep, that would be it.

    Try this- go edit the field format- flip it to something else- apply to all.  Flip it back- apply to all.  Does it now show up w/a value in the form?

    NOTE- if you don’t want all of them set to ‘none’- don’t do this! 😉

  • #13 / Jun 30, 2008 2:15pm

    grantmx

    1439 posts

    Yep, value is still blank.

    I do want them all to be ‘none’.😖   That sounds funny.

  • #14 / Jun 30, 2008 2:19pm

    grantmx

    1439 posts

    I just found another instance of the input right below it.  Must have missed it before.  Its value is set to ‘none’.

    <input type='hidden' name='field_ft_7' value='none' />

    But it’s still not helping the formatting in the preview loop.

  • #15 / Jul 01, 2008 10:33am

    Robin Sowell

    13255 posts

    Just to make sure I’m clear- field_id_7 shows the p tags around it, even with that hidden field showing on the form?  Triple check- because if it’s just the fields not having the default ‘none’ showing, it’s an easy fix.  But if that’s not it, I’m going to have to poke a bit.

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

ExpressionEngine News!

#eecms, #events, #releases