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

    I have one question on combining Maxigallery with Ditto.
    My website is structured like this:
    +articles
       -article_1 (hidden)
       -article_2 (hidden)
       -etc. (hidden)
       +article_details (hidden)
    


    What I try to achieve:

    I have a sidemenu (built by Wayfinder) where the children of "articles" do not appear.
    A klick on "articles" shows the content of the articles-folder in the main section of the website.
    This overview is done through Ditto 2.1 (not showing folders).

    A klick on one item of this list brings you to the chosen article and this detailed view of the article is also rendered through ditto (pagination on, one item per page). So I have "previous" and "next" links in the detailed article view.

    Articles can contain picture galleries (inserted though a chunk called {{pictures}} )

    All in all my galleries are always rendered through ditto, that’s why I use the following {{pictures}} chunk:
    [!MaxiGallery? &gal_query_ids=`[+id+]` &manage_gallery=`[+id+]` &display=`embedded` &embedtype=`lightboxv2` &lang=`de` &thumb_use_dropshadow=`1` &max_thumb_size=`150`!]
    

    This chunk contains the Ditto placeholder [+id+].

    With MaxiGallery 0.5.2 almost everything works, except picture management.

    A detailed article page URL looks like this:
    www.example.tld/articles/article_details.html?start=X (X = [+ditto_iteration+] )

    I can not use Ditto placeholders in MaxiGallery templates (e.g manageOuterTpl) for [+maxigallery.urlaction+] or [+maxigallery.urlback+].
    e.g [+maxigallery.urlaction+] = www.example.tld/articles/article_details.html

    Any hints?

    Regards,

    Manx

      • 7923
      • 4,213 Posts
      You should first create a new document what is used to manage the galleries. E.g. add a maxigallery snippet call there with the same parameters as in the gallery documents, but also ad &is_target=`1` parameter, for example:

      [!MaxiGallery? &is_target=`1` &display=`embedded` &embedtype=`lightboxv2` &lang=`de` &thumb_use_dropshadow=`1` &max_thumb_size=`150`!]

      Then in ditto’s template, you should use &view_gallery=`[+id+]` and &manage_target=`<document_id_here>` parameters, where the document_id_here is the id of the document you created to manage the galleries..




        "He can have a lollipop any time he wants to. That's what it means to be a programmer."
        • 18191
        • 5 Posts
        Hi doze & thanks!

        [*EDIT*] Sorry!

        I’m sorry but I mixed up some templates, trying again!

        [*EDIT2*] Thanks a lot doze, works as expected!

        Thanks,

        Manx
          • 22427
          • 793 Posts
          Hi everybody out there!

          In a similar context I’ve got the problem that the links from the thumbnails to their pictures will not work.

          My picture manager page (id=77) contains this snippet call: [!MaxiGallery? &is_target=`1` !].

          There are several gallery documents, children of my gallery page which contains the following Ditto call:
          [!Ditto? parents=`[*id*]` &tpl=`galTpl` &display=`99` !],
          where the Template reads like this:

          <a id="a[+id+]"></a>
          <h2> [+menutitle+] </h2>
          [+content+]
          [[MaxiGallery? &display=`normal` &manage_target=`77` &view_gallery=`[+id+]` ]]

          The gallery page is listing nicely each gallery, displaying its thumbnails as expected. But when I click on a thumb I get a page with only the h2-heading and an empty content - no picture.
          (The generated link is, e.g., "..../index.php?id=88&pic=256&from_id=66" - where id=66 is the gallery page and id=88 the single gallery.)

          By the way: The thumbs and pictures obviously are correctly created in the folder galleries/66/, using Resynch Gallery.

          What’s going wrong?
          Thank you for any hints!

          ottogal


            • 7923
            • 4,213 Posts
            The thumbnails shouldn’t be created to galleries/66/ when syncing a gallery if 66 is the page that simply shows various galleries with &view_gallery parameter, they should be in the individual gallery documents eg. galleries/88/ and so on..

            So.. maybe there is a bug in resynch when using &view_gallery parameter.. I’ll check that. It should be ok though, because the managing works ok and they use the same id in code.. but I’ll see.. What version are you using?

            EDIT: Like I thought, works ok for me.. here’s what I tried:

            Document with ID 5 has [!MaxiGallery!]
            Document with ID 4 has [!MaxiGallery? &is_target=`1`!]
            Document with ID 3 has [!MaxiGallery? &view_gallery=`5` &manage_target=`4` &display=`normal`!]

            Eg. the document with ID 3 in my example would be the document that has Ditto to list each gallery document, and document with ID 5 is a gallery document. Document with ID 4 is used to manage the galleries.

            I added pictures in /assets/galleries/5 and went to document with ID 3, hit manage pictures button and arrived to document with ID 4 (index.php?id=4&gal_id=5) to manage the gallery (ID 5) and after clicking resynch, the new pictures was made into thumbnails in /assets/galleries/5. Nothing comes under /assets/galleries/3.


              "He can have a lollipop any time he wants to. That's what it means to be a programmer."
              • 22427
              • 793 Posts
              Thank you, doze!
              The thumbnails shouldn’t be created to galleries/66/ when syncing a gallery if 66 is the page that simply shows various galleries with &view_gallery parameter, they should be in the individual gallery documents eg. galleries/88/ and so on..
              Sorry, that was only a typo - I meant galleries/88/.
              Document with ID 5 has [!MaxiGallery!]
              Document with ID 4 has [!MaxiGallery? &is_target=`1`!]
              Document with ID 3 has [!MaxiGallery? &view_gallery=`5` &manage_target=`4` &display=`normal`!]
              So far I had no MaxiGallery Call in ID 5 (=88 in my example). I tried to write [!MaxiGallery!] into its content: It will show as the code "[!MaxiGallery!]", no pixture.
              Then I tried the call [!MaxiGallery? &display=`normal`!] ... and there is the picture!!
              BUT: The text "[!MaxiGallery!]" remains like before... huh
              ottogal
                • 7923
                • 4,213 Posts
                View the document with RTE off or with text editor set to none to see if there’s odd characters in the snippet call..


                  "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                  • 22427
                  • 793 Posts
                  I checked that - no odd characters.
                  Playing around a bit I found that the call [!MaxiGallery!] in ID 5 is ok (no need of &display=`normal`, of course, that’s default).
                  But in ID 3 the source code created by Ditto contains the text "[!MaxiGallery!]" preceeding each form call of "Manage pictures" for the individual galleries.
                  I tried also changing calls from cached to uncached and back - no difference.
                    • 7923
                    • 4,213 Posts
                    It’s because you have [+content+] in your ditto template and it returns the content from the gallery document what is [!MaxiGallery!].. If you really need ditto to return the content from the gallery documents too, you can for example put the MaxiGallery call from the gallery documents to the site template, so it’s out from the content field.. you can wrap the call in the site template to some snippet (or phx conditional) to define whether the snippet should be run or not if you want to have single site template for all pages..


                      "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                      • 22427
                      • 793 Posts
                      That’s it, indeed. Thank you, doze, for having given a glance at my stuff - and for your additional tips!
                      ottogal