We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 40447
    • 165 Posts
    Hi, I'm using modx evo 1.0.6
    I'm working on a simple website that has a homepage, intropage and pages with a lot of images (around 200). I want to use 6 pages to show all the pictures. Each page holds a slideshow that is driven by javascript and shows 30 pictures. I can put the css and the javascript for the slideshow in a chunk on the template for the 6 pages. I have divided the pictures for each page in 6 subfolders. My problem now are the paths to the pictures. These paths are needed in the javascript of the slideshow on each of the 6 pages. Since the pictures have different names and are in 6 different folders I can't include the paths in a chunk on the template. So far I use a TV in combination with @File to pull in the html containing the paths to the pictures. In each of the 6 folders where the pictures are I also put a html file holding the paths to the pictures in that specific folder. @File points to such a html file. On each resource (page) I edit the TV @File to point to the html file in the right folder. Now I am wondering if there is another more efficient solution than this ? Is it possible to use the DataBase or a resource page instead of external files ?
    Greetings Brian.
      • 3109 ☆ A M B ☆
      • 894 Posts
      You could use pHX to check the ID of which page it currently is on and change the paths accordingly.

      Something like this:

      
      <img src="[+phx:if=`[*id*]`:is=`2`:then=`{ {imagePath/imageName} }`+].jpg" />
      
      


      You can read more about pHX here.

      Hope that helps, good luck.
        Benjamin Marte
        Interactive Media Developer
        Follow Me on Twitter | Visit my site | Learn MODX
        • 40447
        • 165 Posts
        Thanks for your reply. I understand the basics of modx but I'm still learning how to apply the logics and the api inside modx. Quite a learning curve for a newbie.
        Greetings Brian.