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

    How could I list documents that aren’t parent of any other ?

    Any special Wayfinder configuration ?

    I’m designing a site with products ordered into many categories and subcategories (i.e. folders).
    A visitor can ask information for any product, presented by a distinct document.

    What I want to do is a panel of checkboxes listing all available products (i.e. titles of documents that are leaves) and check boxes corresponding to products for which informations are requested.

    Thanks for any help.
      • 20413
      • 2,877 Posts
      Some links that might help you:
      http://ditto.modxcms.com/tutorials/basic_filtering.html
      http://www.modx.wangba.fr/index.php?id=197
      http://modxcms.com/forums/index.php/topic,16456.0.html

      All docs are assigned `0` as parent, you can use ditto tagging by tv or tagsource some other field e.g. longtitle...

      //Wayfinder ---> &excludeDocs=`...`
        @hawproductions | http://mrhaw.com/

        Infograph: MODX Advanced Install in 7 steps:
        http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

        Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
        http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
        • 15001
        • 697 Posts
        Thanks a lot.
        Ditto might be the right snippet for my need.

        I looked at the linked documents and installed the tvEditor module.
        tvEditor/tvExplorer look very powerful to build search forms.
        I’ll probably take the time to learn them.
        But for my simple needs, it looks a little bit complicated.

        I don’t want to make a search form but just to list all available products which are about 20 and have one checkbox for each product name.

        Maybe the easier way will be hacking a little bit the database with a PHP/MySQL request to find if a document has any child and exclude it from the list if it has.

        Some details about my project
        On each product page will be one checkbox that a visitor can click to tell if he wants more information about a product. There will also be an "array" of checkboxes summarizing which products the visitor is interested in. I plan to use some cookie to transmit the state of this "checkboxes panel" from one page to another.
          • 15001
          • 697 Posts
          Thanks Ganesh,

          For 2009, I hope reading the docs more carefully...

          &hideFolder=`1` should do what I expect.

          Still a small problem with my Ditto call which is inside a Wayfinder chunk :
          $rowTpl = '@CODE:<h3>[+wf.title+]</h3>[[!Ditto? &parents=`49` &depth=`all` &hideFolders=`1` &tpl=`checkbox_produit` !]]';

          I tried adding one more [ ] sandwich, but the squared parenthesis displayed. Should I escape some chararacters ?
            • 15001
            • 697 Posts
            Solved !

            I had to alternate the cached and uncached modes for snippet calls as one is inside another.

            In my case, this is the configuration for a Wayfinder row :
            $rowTpl = '@CODE:<h3>[+wf.title+]</h3>[!Ditto? &parents=`[+wf.docid+]` &depth=`3` &hideFolders=`1` &tpl=`checkbox_produit`!]';

            The Wayfinder snippet is called cached ( [[Wayfinder? ]] ), so Ditto must be called uncached ( [!Ditto? !] ).

            hideFolders, that ganeshXL mentioned was the right parameter to only list documents that are leaves.

            The code above displays a checkbox for each document in a product category.
            The name of product categories are displayed in the <h3>...</h3> sandwich.

            Chunk checkbox_produit :
            <div class="chkInfo"><input type="checkbox" value="[+pagetitle+]">[+pagetitle+]</input></div>