We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 27330
    • 884 Posts
    Hi all,
    I'm working on a real estate listing site. On each property page I have this gallery call
    [[!Gallery? &imageWidth=`680` &toPlaceholder=`gallery` &album=`[[*pagetitle]]`]]
    [[!GalleryItem? &imageWidth=`680`]]
    
    
    <div id="propertyGallery">
    <div class="ad-gallery">
      <div class="ad-image-wrapper">
        
      </div>
      <div class="ad-controls">
      </div>
      <div class="ad-nav">
        <div class="ad-thumbs">
          <ul class="ad-thumb-list">
           [[!+gallery:notempty=`
    [[+gallery]]
    `]]
           
          </ul>
        </div>
      </div>
    </div>
    
    </div>
    <br style="clear:both;" />
    


    The problem is that if I haven't created a gallery album named as the pagetitle I see the gallery layout but no images.
    I would rather hide the whole html layout if the gallery is not exist.

      • 36442
      • 97 Posts
      warsteiner80 Reply #2, 12 years ago
      So put all your gallery HTML inside conditional result:
      [[!+gallery:notempty=`
      <div id="propertyGallery">
      <div class="ad-gallery">
        <div class="ad-image-wrapper">
           
        </div>
        <div class="ad-controls">
        </div>
        <div class="ad-nav">
          <div class="ad-thumbs">
            <ul class="ad-thumb-list">
      		[[+gallery]]
            </ul>
          </div>
        </div>
      </div>
       
      </div>
      <br style="clear:both;" />
      `]]

      And it's much better for performance to use special snippet, then output modifier. Use If addon in this case.