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.

If conditional works but not on all pages

February 24, 2011 6:19pm

Subscribe [2]
  • #1 / Feb 24, 2011 6:19pm

    richardmeredith

    48 posts

    Hi, wonder if anyone can shed some light on this.

    I’ve got a wedding channel which we publish to. The template for this is wedding which shows the 1st article in the content. It has a nav on left which link to the other published pages.

    I’ve got an if conditional (see code below) which doesn’t work on the template page eg: site/wedding but works on the other pages eg: site/wedding/cakes

    I’ve got if conditionals for stylesheets and they work fine.

    Any ideas?

    The if conditional:

    {exp:channel:entries}
    
    {if wedding-gallery} 
    
      <!-- START: Gallery Container -->
      <div id="gallery-container">
        <!-- START: Slider -->
        <ul id="slider">
          <li>
    
            {wedding-gallery} 
    
              <?php if ({count} > 1 && {count} % 3 == 1): ?>
                </li><li>
              <?php endif ?>
              {wedding-cake-information}
       <!-- START: Product -->
          <div class="product">
                {image}
          <a href="http://{title_permalink={template_group}/wedding-cake-details}">Find out more</a>
    
     </div>
          <!-- END: Product -->
              {/wedding-cake-information}
    
            {/wedding-gallery}
    
          </li>
        </ul>
        <!-- END: Slider --> 
      </div>
      <!-- END: Gallery Container --> 
    
    {/if}
    {/exp:channel:entries}
  • #2 / Feb 25, 2011 9:36am

    zizther

    228 posts

    Hi,

    Are you specifiying the channel you want the content to come from?
    EG: {exp:channel:entries channel="weddings"}  rather than   {exp:channel:entries}

  • #3 / Feb 25, 2011 9:54am

    richardmeredith

    48 posts

    Zizther, that was it. I was code blind, had used it throughout the rest of the page but not on these parts.

    Thank you so much!!

    😊

  • #4 / Feb 25, 2011 9:58am

    zizther

    228 posts

    No worries, glad it was only that simple!

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

ExpressionEngine News!

#eecms, #events, #releases