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

    I’m currently making a "weblinks" section for my future website.

    Here is how is my document structure :
    Category A
           SubCategory A1
                WebLink A1_a
                WebLink A1_b
            SubCategory A2
                WebLink A2_a
                WebLink A2_b
                WebLink A2_3
    Category B
    

    In my subcategories, the page content is :
    <ul>
    [[Ditto? &tpl=`chunkLinks`]]
    </ul>

    The "chunkLinks" chunk looks like :
    <li><a href="[~[+id+]~]" title="[+title+]">[+title+]</a> : [+description+]</li>


    So far, no problem! tongue

    But now, I’d like to have in my "Category A" page, the subcategories with their content.

    So I wrote :
    [[Ditto? &tpl=`chunkLinksCat` &extenders=`summary` &trunc=`0`]]

    The "chunkLinksCat" chunk looks like :
    <h5><a href="[~[+id+]~]" title="[+title+]">[+title+]</a></h5>
    <ul>
    [+summary+]
    </ul>

    I was hoping that for each subcategory fetched, my ditto would call the ditto in the subcategory and put the content [+summary+] placeholder...

    But it doesn’t work... undecided


    So my questions are :

    1/ Is it possible to do that?

    2/ Does that have something to do with the "id" parameter of Ditto? I tried changing that, without success.

    3/ Should I use instead the plugin/snippet Favorite Links, knowing that I would link maximum 100 weblinks... (I haven’t tested it, thinking that it wasn’t necessary for my usage to setup such scripts). What are your recommandations concerning this point?

    Thank you in advance for your answers smiley!
      • 18397
      • 3,250 Posts
      Do you want for Category A a hierarchical list or a flat list. If you want hierarchical list use Wayfinder with a custom item template. Otherwise, set &depth=`3` &hideFolders=`1` &tpl=`chunkLinks` and you should be set.

      PS: You might want to use {+content+] instead of [~[+id+]~] for the weblinks as that will display their actual URL instead of their MODx url.
        • 22533
        • 41 Posts
        Quote from: Mark at Apr 05, 2007, 07:34 AM

        Do you want for Category A a hierarchical list or a flat list. If you want hierarchical list use Wayfinder with a custom item template. Otherwise, set &depth=`3` &hideFolders=`1` &tpl=`chunkLinks` and you should be set.
        Indeed, it was easier with wayfinder! Don’t know why I didn’t think about it first... maybe ’cause I’m starting to understand the potential of ditto and I’m still testing a few things! smiley

        Quote from: Mark at Apr 05, 2007, 07:34 AM

        PS: You might want to use {+content+] instead of [~[+id+]~] for the weblinks as that will display their actual URL instead of their MODx url.
        Yes, that’s more pertinent!

        But in the end, I choose to use the "Favorite Links" plugin/snippet.
        I tried it and now I think it would be of a best for what I want to do (tagging is cool and complexies in a good way).

        Thank you!