We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32070
    • 87 Posts
    I’m building a slideshow for a client similar to the one found here: http://www.tuchmade.com/. It uses jQuery innerfade.

    I’m trying to figure out best practice....

    I want to be able to have my client be able to select anywhere from 2-9 images, and to filter out any that are empty so that only the images with a specified value will result in HTML output.

    Each image in the slideshow basically looks like this:

    <li class="slideshow-item" style="z-index: 4; position: absolute; display: block; ">
    <a href="somelink.html" ><span style="display: none">test</span></a>
    </li>
    


    My first approach was to simply create 9 template variables (i.e. slideshow-image-1, slideshow-image-2, etc) and try to figure out how to write a snippet that would get all of these resources, and parse through them....

    Then I thought, why not create a container with 9 resources in it that all have a single TV (slideshow-image) assigned to them - that’s easily managed via getResources.....

    I just need to know if there’s a best practice on this. Any suggestions? How would you handle this.
      Des
      webandflowdesign.com
      • 19369
      • 1,098 Posts
      I used to do it with PHx (MODx Evolution), for example:

      [+phx:if=`[*img-01*]`:is=``:then=``:else=`
      <li class="slideshow-item" style="z-index: 4; position: absolute; display: block; ">
      <img src="[*img-01*]" alt="#" />
      `+]


      With Revolution I think that you can achive the same with filters (the ifempty,default,empty modifier):
      http://rtfm.modx.com//display/revolution20/Input+and+Output+Filters