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.

p tag being added to custom field even though text formatting is set to None

September 27, 2010 11:44pm

Subscribe [4]
  • #1 / Sep 27, 2010 11:44pm

    JulesWebb

    271 posts

    I’ve created the Custom Field “custom-script” it has a Field Type of textarea and the “Default Text Formatting for This Field” is set to “None”

    To bring this into the page I have:

    {exp:weblog:entries weblog="equine-news" limit="1" disable="member_data|comments|trackbacks|pagination" status="open|Announcement"}
    {if custom-script != ""}{custom-script}{/if} 
    {/exp:weblog:entries}

    If “custom-script” is empty it’s not included and all is well.

    If “custom-script” is not empty then the script is included.  The problem is the it’s also including a pair of empty p tags (see below)  I don’t know why they’re showing up or how to prevent them from being added. Appreciate any help, thanks ~Jules

    <!-- BEGIN custom script   -->
    script type="text/javascript"
     my script
    script> 
     
    <!-- END custom script  -->
  • #2 / Sep 28, 2010 3:43pm

    Ingmar

    29245 posts

    What version and build of EE are you using? Any extensions? Do you’ve got a link?

  • #3 / Sep 28, 2010 6:01pm

    JulesWebb

    271 posts

    ExpressionEngine 1.6.9
    Build:  20100430

    http://www.meddletonequine.com/equine-news/read/what-are-summer-sores/

    Using Firefox the issue was on line 1047 in the source code.

    Not exactly sure what you mean by extensions.  I of course have a number of extensions installed, but I find it unlikely that you want me to list them all out. I didn’t have to install any extension to implement this additional field.

    thanks for your help!
    Jules

  • #4 / Sep 29, 2010 10:29am

    Sue Crocker

    26054 posts

    Jules, if you temporarily disable your extensions by using the big green button labeled “Disable Extensions”, does the problem still happen?

  • #5 / Sep 29, 2010 8:40pm

    JulesWebb

    271 posts

    I temporarily disabled my extensions as suggested and the p tags still showed up

  • #6 / Sep 30, 2010 11:46am

    Sue Crocker

    26054 posts

    How did you add the entry? Was it from within the EE control panel back end, or some other method?

  • #7 / Sep 30, 2010 7:27pm

    JulesWebb

    271 posts

    Yes, I added the entry using the backend manager. Hover over Publish and click on Equine News.  A new article entry page shows up and I add content.

  • #8 / Oct 01, 2010 3:01pm

    Sue Crocker

    26054 posts

    Can you post the exact text you’re using in your custom script? I’m going to try it in a vanilla 1.6.9 install.

  • #9 / Oct 01, 2010 5:24pm

    JulesWebb

    271 posts

    This is the custom script that is inside the custom field on the article from: http://www.meddletonequine.com/equine-news/read/what-are-summer-sores

    But since the forum removes js it would be easier to look at the source code of the page.  It adds an empty pair of p tags right after the closing script tag

    [removed][removed]
    [removed][removed]
    
    [removed]
            $(document).ready(function() {
        
                $("a.fancygallery").fancybox({
                    
                    'titlePosition' : 'inside',
                    'autoScale'       : false,
                    'transitionIn'    : 'elastic',
                    'transitionOut'    : 'fade'                
                });
                
                
            });
    [removed]
  • #10 / Oct 03, 2010 1:54pm

    Greg Salt

    3988 posts

    Hi WebbDiva,

    Are you cut and pasting this script from somewhere else or typing it in directly?

    Cheers

    Greg

  • #11 / Oct 03, 2010 4:09pm

    JulesWebb

    271 posts

    I copied the code directly from my page and pasted it here.  Just figured javascript was removed because it wasn’t allowed.

    Jules

  • #12 / Oct 04, 2010 10:39am

    Sue Crocker

    26054 posts

    Yeah, it gets removed.

    Unfortunately, I can’t replicate the issue you’re seeing with a simple attempt to replicate.

    I don’t get a trailing paragraph pair.

    Can you try this by itself on a more vanilla template?

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

ExpressionEngine News!

#eecms, #events, #releases