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

    I need to show 1 image, from a document that is using maxigallery... there is any way to get information from maxigallery using ditto?

    I need to show the 1st image, or maybe a random image of that gallery...

    Im using evo 1.0.5, maxigallery 0.5.2...

    best regards!
    luciano
      • 22427
      • 793 Posts
      Try a MaxiGallery call like this:
      [[MaxiGallery? &view_gallery=`777` &manage_target=`888` &order_by=`random` &limit=`1` &manageButtonTpl=`` ]]
      where you replace 777 by the id of the document containing the gallery and 888 by the id of your target resource.
        • 17705
        • 501 Posts
        Mmmm, interesting...

        But... I have to show news, in a "blog" way... that is why I was using ditto...
        I can use that in a ditto chunk... but how can I tell maxigallery to show each child gallery? (and not a hardcoded one)
          • 22427
          • 793 Posts
          I assume your galleries are all children of one resource "galleries". Then in its template you need a Ditto call like this:
          [!Ditto? &parents=`[*id*]` &sortBy=`menuindex` &sortDir=`ASC` &tpl=`GalleryTeaserTpl` &display=`999` !]
          

          Here the template "GalleryTeaserTpl" contains the MaxiGallery call:
          [[MaxiGallery? &view_gallery=`[+id+]` &manage_target=`888` &order_by=`random` &limit=`1` &manageButtonTpl=`` ]]
          where instead of the hard coded [tt]777[/tt] you have to take [+id+], so MaxiGallery is displaying the individual gallery for the actual Ditto list item.

          The Ditto parameter [tt]&parents=`[*id*]`[/tt] indicates that Ditto has to list all the children of the resource which contains the Ditto call.
          In case you need the listing not on the page "galleries" but on another page, you can use [tt]&parents=`111`[/tt] , if [tt]111[/tt] is the id of your page "galleries".
          If your galleries are not children of a single resource, you can use the [tt]&documents[/tt] parameter instead of [tt]&parents[/tt] and just indicate all the gallery pages, f. i. [tt]&documents=`777,778,911,912,913`[/tt] .
            • 17705
            • 501 Posts
            Oh, thanks a lot for your explanations ottogal!
            Its working great now... smiley