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

    1. Is it possible to order childgalleries by TV? Parameter &childgalleries_order_by can order childgalleries MODx through the document object field. And I have some fields set through TV. Tried:

    [!MaxiGallery? &display=`childgalleries` &childgalleries_limit=`5` &childgalleries_order_by=`mytv`!]

    Does not work, as I expected. Would appreciate any other idea on how to do this.

    2. How to paginate childgalleries? Parameter &childgalleries_limit defines the number of childgalleries to list. Nice. But it does not turn on pagination automatically? Say I have 5 galleries on one page, but how can I see next five, and next?

    Thank you!
      • 7923
      • 4,213 Posts
      1. try with &childgalleries_order_by=`tvTVNAMEHERE`, eg. if your tv name is mytv, it would be &childgalleries_order_by=`tvmytv`

      2. It’s not possible to paginate childgalleries. For more customized lists, use Ditto for example to list the gallery documents and use MaxiGallery in Ditto’s row template to get a picture(s) from the gallery.


        "He can have a lollipop any time he wants to. That's what it means to be a programmer."
        • 37379
        • 41 Posts
        Quote from: doze at Feb 11, 2010, 10:08 AM

        1. try with &childgalleries_order_by=`tvTVNAMEHERE`, eg. if your tv name is mytv, it would be &childgalleries_order_by=`tvmytv`

        Thank you doze. In my case the tv name is space. I followed your advise and unfortunately page says:

        « Execution of a query to the database failed - Unknown column ’sc.tvspace’ in ’order clause’ »
        SQL: SELECT DISTINCT sc.* FROM `db_afil_1`.`modx_site_content` sc LEFT JOIN `db_afil_1`.`modx_document_groups` dg on dg.document = sc.id WHERE (sc.id IN (87,88,89) AND sc.published=1 AND sc.deleted=0 ) AND (sc.privateweb=0) GROUP BY sc.id ORDER BY sc.tvspace ASC

        Hm. What that sc. prefix could be?

        Quote from: doze at Feb 11, 2010, 10:08 AM

        2. It’s not possible to paginate childgalleries. For more customized lists, use Ditto for example to list the gallery documents and use MaxiGallery in Ditto’s row template to get a picture(s) from the gallery.

        Yes. Ditto can paginate. But will it be possible to combine these Ditto pagination calls with MaxiGallery tv-sorting then? Mmm... And Ditto has &orderBy some values too. But I can’t understand if TV can be that value. Confused.

        A bit strange that childgalleries has no pagination. See, I know so many people complaining "there is no good catalog in MODx". I tried MaxiGallery and think now it could be a perfect solution. What do we usually need for a catalog is a good listing page with some parameters sorting (best through tv) and pagination. That could be a childgalleries page. Then when choosing an item from that page we see a detailed product page, which could be done out of a gallery page. Nice and easy! If there’s somebody know the solution for that even besides MaxiGallery I’d appreciate any help. Thanx.
          • 7923
          • 4,213 Posts
          Just use ditto to list the gallery documents.. I bet it can order by TV content too. See the docs for it.

          And you can use maxigallery in Dittos row template to get the pics.


            "He can have a lollipop any time he wants to. That's what it means to be a programmer."
            • 37379
            • 41 Posts
            Quote from: doze at Feb 14, 2010, 10:55 AM

            Just use ditto to list the gallery documents.. I bet it can order by TV content too. See the docs for it.
            And you can use maxigallery in Dittos row template to get the pics.

            Hi again!

            Well, I followed your advise but could not manage MG to show up through the Ditto call using &tpl.
            This is what happens:

            The following code is displayed nicely by [!MaxiGallery? &display=`childgalleries` &childgalleries_limit=`5` &childgalleries_order_by=`[*mytv*]`!] :

            [+maxigallery.pageinfo.pagetitle:htmlent+] - for the page info.
            [+maxigallery.pageinfo.tv.mytv+] - for my tv.
            and plus some html code as usual.

            It works with MaxiGallery. Now I want to paginate and sort it with Ditto. I made a template chunk {{mg_childs}} with that code. Then called Ditto the following way:

            [!Ditto? &tpl=`mg_childs` &summarize=`5` &paginate=`1` &paginateAlwaysShowLinks=`1` &orderBy=`[*mytv*]`!]
            <div id="ditto_pages"> [+previous+] [+pages+] [+next+] </div>

            Is that the idea? Well, html code is displayed OK smiley of course. As well as pagination. But those maxigallery placeholders are simply empty sad Ditto doesn’t see them.
            Any ideas why? Thanks in advance!
              • 7923
              • 4,213 Posts
              So what’s the exact content of mg_childs chunk?

              When you use snippet calls inside another snippet call, you need to alter the caching level..

              Eg. your mg_childs chunk should be something like:

              [[MaxiGallery? &view_gallery=`[+id+]` &limit=`1`]]

              And the &orderBy parameter in your Ditto call is wrong, it should be:

              [!Ditto? &tpl=`mg_childs` &summarize=`5` &paginate=`1` &paginateAlwaysShowLinks=`1` &orderBy=`mytv`!]


                "He can have a lollipop any time he wants to. That's what it means to be a programmer."