1

Im stuck - Ive got a simple portfolio site with a few channels, lists, search and so forth. Im using Supersized with Channel Images to run galleries. I made the first gallery (for the background full screen slides) using an entry in a dedicated channel, uploaded a bunch of images, and used the following code to run the script:

 {exp:channel:entries channel="gallery" entry_id="18" enable="custom_fields" parse="inward" limit="1"}


       jQuery(function($){

    /... all the supersized stuff before the slides list .../


    slides  :
       [
       {gallery_image}
       {image : '{image:url:full-size-op}', title : '{image:title}', thumb : '{image:url:thumbnail}'},
       {/gallery_image}

        ]
      });
          });


    {/exp:channel:entries}

This works fine* in all sections of the site, except the (single) entry pages. Why is it breaking, has anyone come across anything similar? Even though it has a last trailing comma, that doesn't seem to be a problem. In other words, by segment_3, it breaks, like this: www.mydomain.com/channel/entry/entry_title (Im running the site without index.php.)

(* - Caveat: in IE8 the script breaks as it returns an error to do with 'thumb_links' being undefined, even though they are. My code isn't the cause of that break, but its a separate issue). UPDATE ON THIS: My code was the cause - removing the last comma sorted this issue out, using backspace="5".

0

Try adding dynamic="no" to your {exp:channel:entries} tag

{exp:channel:entries channel="gallery" entry_id="18" dynamic="no"}

HERE'S INFO FROM THE DOCS

The channel display engine sets some parameters dynamically, based on what is in the URL. There are times, however, where you do not want the parameters affected by what the URL contains. To override the dynamic nature of the channel tag, use dynamic="no".

This is often useful if you want to list entries in a “sidebar” on your site and have them always be the same ones regardless of which page on your site you visit (main page, archives, comments, etc.). By setting dynamic="no" you will ensure that the list is not affected by anything passed in the URL.


Also, you do not need these parameters (enable="custom_fields" parse="inward") on your channel:entries tag. They are not valid... here is a list of valid parameters for the channel:entries tag.

2
  • 1
    Thats done the trick - I wouldn't have thought of it, thank you so much!! I used 'enable="custom_fields"' as its used in one of the Channel Images tutorials, I hadn't come across it before, and as I'm not using any other fields, it seemed useful (and works everywhere else in the site). As to 'parse="inward"', I was trying that to load the images earlier in the DOM as it can be useful sometimes. You are right though, I probably dont need them. Id like to know why 'dynamic="no"' cures this problem as had tried lots of things to solve it. – Boshy Sep 20 '13 at 20:05
  • 1
    Great! I added the explanation of the dynamic parameter from the EE docs to my answer... Basically, by default EE looks at the URL for certain things. When it finds a match the tags in the templates will display data based on that match. So on your detail template there was a match based on your segment_3 and it was affecting this tag. Setting dynamic="no" tells EE not to look at the URL for any direction and to use exactly what you've coded in the template. – Anna_MediaGirl Sep 21 '13 at 0:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.