We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36673
    • 1 Posts
    Hi, everybody!

    Here is the default method to output an album (created with Gallery) on a document page:
    * Create an album in Gallery, upload images
    * Keep in mind the ID of album you have just created
    * Create a document (resource). Insert into resource content area a snippet call
    [[!Gallery &album=`ID`]]
    passing the album ID in parameters.

    This method works fine in most cases but sometimes looks a bit complex.

    In my project I have to establish one-to-one relationship between albums and documents. i.e. each album must be published in only one document. And therefore managing albums becomes a superfluous task.

    Suppose, there are 100 documents and 100 albums on the site. How to tell quickly what document a given album belongs to? Which albums are really published and which are not? How to easily delete the right album after a document deletion?

    Could someone suggest a way to automatically track relations between albums and galleries?
    Or may be suggest totally different way to attach multiple images to a resource – may be like MaxiGallery did in Evo?

    I am totally new to MODX, so maybe I am just missing something

    Thanks in advance [ed. note: xtx.dev last edited this post 15 years, 2 months ago.]
      • 20031
      • 19 Posts
      Automatically connecting the gallery:
      If you name the album exactly the same as the resource title, you could make a snippet that found the album by its name and include the snippet in the template. That is, if you don't mind an extra query.

      OR

      Simpler Management:
      You could make a template variable where the input option is galleryalbumlist. Remember to give your template access to the TV.

      you would then have to select it in a dropdownlist in the resource.