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

    I’m doing a small catalog where I need to list subcategories when choosing a category in the navigation.

    The tree looks like this:
    Category
    ->Subcategory
    ->Product
    ->Product
    ->Product
    ->Subcategory
    ->Product
    ->Product
    ->Product

    When you click a link in the navigation a page shows where new navigation is found. Here the Subcategory title is a header (thus the content of the subcategory document is blank) and the product titles are links in the new navigation.

    I’m using a ditto-call to create these lists:
    [!Ditto? &tpl=`produktliste` &sortDir=`ASC` &display=`all` &tplAlt=`produktliste2`!]


    The templates are practically just a div with a wayfinder-call to list the links for the products..

    My problem is that the last subcategory i made need to be the first one showed on the page, but I the order of the rest has to be the same so I can’t just change the sortDir to descending. Is there a way for me to reorder this? I was thinking that maybe i had to use wayfinder to call the subcategories as well in order to set the order as i wanted it (menu-listing) but i’m thinking there probable is a simple solution to this, still using ditto.
      • 1122
      • 209 Posts
      Two calls of Ditto. First call lists the last category alone and the second all remaining documents/categories.
      [!Ditto? &documents=`lastcatid` ..............!]
      [!Ditto? &documents=`id,id,...` ..............!]
      
        • 13331
        • 67 Posts
        Thank you but I’m showing two subcategories per line. tpl1 is creating a div with the wayfinder call and tpl2 is creating a div with the wayfinder call (and a linebreak)

        When i do as you describe the remaining documents are also showing in random order.