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.

Php outputting wierd <p> and rogue tags

May 06, 2008 10:20am

Subscribe [2]
  • #1 / May 06, 2008 10:20am

    John Macpherson

    113 posts

    Hi guys im trying to get descriptions working alongside the fantastic file plugin.

    Im trying this code:

    <?php
        $pictureNames = "{parts-description}";
        $pictureNamesArray = explode(",",$pictureNames);
        $pictureCounter = 0;
    ?>
    
    {p-image}
    <div class="content-inner">
    <a href="http://{file_url}" class="imger">{file_thumb_url}</a>
    <?php echo "$pictureNamesArray[$pictureCounter]"; $pictureCounter++; ?>
    </div>
    {/p-image}

    As you will see im trying to explode the data with a comma. Iv tried a “\n” for line breaks but it still doesnt output the proper html. Iv turned formating off in the custom field but im getting something similar to this.

    <div class="content-inner">
    <a href="http://.../images/uploads/parts/HAYTER-1030.jpg" class="imger">...images/uploads/parts/HAYTER-1030_thumb.jpg</a>
    KTM 123 pic 1
    
    </div>
    
    <div class="content-inner">
    <a href="http://images/uploads/parts/Hayter_logo_Large.gif" class="imger">/uploads/parts/Hayter_logo_Large_thumb.gif</a>
    
    KTM pic 2
    

    Notice the empty on the second proposed paragraph.

    As always any help appreciated.Thanks.

  • #2 / May 06, 2008 11:00am

    Andy Harris

    958 posts

    I know little (no, nothing) about this plugin, but I did spot that you seem to be closing a </p> but not opening it on your top code block (line 10ish!) It might be that the echo statement adds it automatically though…

  • #3 / May 06, 2008 12:27pm

    John Macpherson

    113 posts

    Thanks for the reply, yeah i manually inserted that in, to counteract the automated entry it was inserting.

    I replicated everything again and it seems to now be working on the same code.

    Is there such a thing as a cache issue with templates / content?

    One thing could be that the initial entries accepting xhtml when i chnaged over to formatting : none it didnt swap across. Although i did create a new weblog entry and the issue was still there. Strange really.

    Anyone shed some light? Thanks.

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

ExpressionEngine News!

#eecms, #events, #releases