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.

Template code is parsed when rendered but is then output again unparsed at the end of page.

May 18, 2011 1:46am

Subscribe [3]
  • #1 / May 18, 2011 1:46am

    cmscss

    144 posts

    Hi There,

    We have a template where EE tags are parsed correctly on the rendered page but then directly under that output, the page is output again with the unparsed tags.

    The page can be seen here.

    You have to view the source to see the unparsed tags.

    Pretty much the same template can be seen rendering correctly on a live site in the same MSM install here.

    We’re having trouble getting the main images to display and noticed this strange behavior - does anyone know how to fix this?

    Any help would be much appreciated.

    Cheers

    Ben

  • #2 / May 18, 2011 1:50am

    Cheif

    626 posts

    It appears that the repeated content is sitting inside your javascript tags. I’ve seen similar things where there is no 404 page so it defaults to the default pages content - whats living inside your JS tags ?

  • #3 / May 18, 2011 1:55am

    cmscss

    144 posts

    Thanks heaps for the reply!

    Here’s the raw template code for the javascript section:

    <!-- SCRIPT INCLUDES -->
    <!-- activate tabs with JavaScript -->
    [removed]
    
    $(function() {
    
    // slider
    $(".slider_tabs").tabs(".slides > div", {
    effect: 'fade',
    fadeInSpeed: 800,
    rotate: true
    
    }).slideshow({autoplay: {autoplay}, interval: {autoplay_interval}, autopause: true, clickable: false});
    {/exp:channel:entries}
    
    });
    [removed]


    I didn’t have a 404 page set so have set one but it didn’t make any difference - cleared the cache etc.

    Cheers

    Ben

  • #4 / May 18, 2011 2:07am

    Cheif

    626 posts

    My best guess is you’re not closing out an EE tag. The javascript content (& subsequent page contents) are repeating multiple times.

    Remove the entire javascript block and see if that improves anything and double check all your EE tags to make sure they are closed!

  • #5 / May 18, 2011 11:29am

    Sue Crocker

    26054 posts

    Thanks for the assist, Cheif.

    Cheif is right, you’ll need to take your template, reduce it down to the basic EE parts, make sure that works, then add in complexity.

    Does that help?

  • #6 / May 18, 2011 1:48pm

    cmscss

    144 posts

    Thanks for the replies guys.

    The thing that’s got me stumped is that this same template is working on 2 other sites in the same MSM install.

    I’ve even copied and pasted the template and site header from one them changing only 3 things:
    - The path to the CSS file in the site header
    - The name of the header snippet
    - The name of the custom field in the template

    I’ve then compared the headers and templates from both sites in Kaleidoscope (an app that compares files for differences) and can confirm that these are the only changes.

    I did notice that after duplicating this particular site, that there were a number of weird defaults (like template debugging) that got turned on or were not the same as the original site.

    Obviously something is different but I’m struggling to find that difference in the templates/front-end - is there anything in EE (no matter how trivial) that might effect template rendering I could toggle?

    Any help would be appreciated.

  • #7 / May 18, 2011 2:20pm

    Mark Bowen

    12637 posts

    You’re not by any chance using embeds are you and perhaps you had selected Static Template when you created the template maybe?

    I’d check that any templates that have ExpressionEngine code in them are not set to Static as that would definitely show the code ‘as is’ in the output.

    Best wishes,

    Mark

  • #8 / May 18, 2011 2:30pm

    cmscss

    144 posts

    Thanks mark,

    The template type is set to web page and if I remove the site header and javascript from the template, I still see the issue.

    This could be a Matrix problem as I’m using Matrix to create the field.

    Cheers

    Ben

  • #9 / May 19, 2011 10:00am

    Sue Crocker

    26054 posts

    Ben, if you look at the source of the file, you’ll see that there is no opening html tag, no css declarations, etc.

    So there’s something else going on. Are you missing an opening embed of some sort?

  • #10 / May 19, 2011 11:22am

    Mark Bowen

    12637 posts

    Seems something has changed since yesterday as all I got when I went to the site were thumbnails and there was a doctype in there at that point in time.

  • #11 / May 19, 2011 3:19pm

    cmscss

    144 posts

    That’s correct guys,

    In an attempt to isolate the exact cause, I removed all styling and javascript to see the raw output from EE.

    For some reason, the 5x images are repeated over and over again - about 10 times. I thought it best to solve this issue first as it’s the only thing I can find which is different from the template that works.

    I’ve been working with Brandon from Pixel and Tonic to see if this is a Matrix issue but I think we’ve concluded that it isn’t. Brandon asked me to place “Matrix” outside the Matrix tag pair and it would appear that it’s the channel entries tag that is getting repeated.

    You can see the output here.

  • #12 / May 19, 2011 3:44pm

    cmscss

    144 posts

    OK, so using limit=“1” forces EE to not loop the output - but why would it repeat the output by default?

    We’ve had a few issues with this particular site in the MSM install and I’d love to track down the causes so I can sleep at night!

    Is using limit=“1” to fix things on pages with one post normal?

    Cheers

  • #13 / May 19, 2011 5:24pm

    Sue Crocker

    26054 posts

    Ben, if you don’t specify an entry_id, a url_title or there isn’t one of these in the url, then EE thinks you want to see all the entries.

    You didn’t show us your exp:channel_entries loop, so this is a guess. Can you put just the code in a new template with the exp:channel:entries loop?

  • #14 / May 19, 2011 5:44pm

    cmscss

    144 posts

    Thanks for that Sue,

    The channel entries tag looked like this:

    {exp:channel:entries channel="galleries"}

    It now looks like this:

    {exp:channel:entries channel="galleries" limit="1"}

    And the url to the gallery entry is:
    /galleries/entry-url/

    Is the /entry-url/ what you mean by “url_title” or is that something different? Also, we use Structure but the galleries are Structure assets which as I understand things, do not add Structure data - but maybe it changes the standard rules on entry-urls?

    The thing I don’t understand is why it works on one site and not on another. The site with the problems is a straight MSM duplication of another site that doesn’t exhibit this issue.

    URL segments seems fairly complex compared to other CMSs we’ve used (it’s something you never think about normally) so sorry for not getting this yet!

  • #15 / May 20, 2011 12:43pm

    Sue Crocker

    26054 posts

    Standard EE will look at the url, and see if the third segment has either a url_title in it, or an entry_id.

    When it has one of these, it knows to only show a single entry.

    But you’re using Structure, which I don’t know much about. (Never used it) So putting in limit=“1” is fine, since you really are only specifying a single entry.

    Does that help?

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

ExpressionEngine News!

#eecms, #events, #releases