We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8416
    • 173 Posts
    Hi,
    I’d like to Ditto to display a list of documents and get the results in a column fashion. The ditto call looks like:

    [!Ditto? &parents=`[*id*]` &depth=`0` &sortBy=`longtitle` &tpl=`columns` &display=`12` &filter=`hidemenu,0`!]
    


    I have 2 "simple" questions:
    1) Can I sort the results by "longtitle", ie: alphabetical order
    2) How should the template "columns" look like to display the result in columns...

    Thanks for any pointers...
      • 8416
      • 173 Posts
      Ok, I solved 2) by using simply the 2 parameters: &sortBy=`longtilte` and &sortDir=`ASC`


        • 18397
        • 3,250 Posts
          • 8416
          • 173 Posts
          Thanks Mark!
            • 19257
            • 141 Posts
            Quote from: Mark at Jan 29, 2008, 01:31 AM

            http://ditto.modxcms.com/examples/columns.html

            How can I do this example? Can anyone let me know what chunk to use for that display of columns?
              • 4310
              • 2,310 Posts
              The CSS, adjust to suit:
              <style type="text/css">
              #columns li h4 {
              text-decoration: none;
              background: #000000 ;
              margin: 0 ;
              color: white;
              padding: 5px !important;
              font-size: 90%;
              }
              #columns li {
              float: left;
              height: auto; /* can set this to keep boxes the same length */
              width: 21% !important;
              margin: 10px;
              border: 1px solid black;
              padding: 5px;
              }
              #columns {
              list-style: none;
              width: 100%;
              margin:20px 0; 
              }
              </style>
              

              The snippet call and surrounding markup, adjust for your docs etc.
              <ul id="columns">
              [!Ditto? &startID=`15` &summarize=`10` &total=`18` &tpl=`ditto_columns` &showarch=`0` &extenders=`summary` &trunc=`1`!]
              </ul>
              <br style="clear: left"/>

              The "ditto_columns" tpl chunk, again choose your own placeholders etc.
              <li>
              <h4>[+pagetitle+]</h4>
              [+summary+]
              <br/>
              [+link+]
              </li>
                • 17282
                • 283 Posts
                Quote from: bunk58 at Jun 06, 2008, 05:02 PM

                The CSS, adjust to suit:
                <style type="text/css">
                #columns li h4 {
                text-decoration: none;
                background: #000000 ;
                margin: 0 ;
                color: white;
                padding: 5px !important;
                font-size: 90%;
                }
                #columns li {
                float: left;
                height: auto; /* can set this to keep boxes the same length */
                width: 21% !important;
                margin: 10px;
                border: 1px solid black;
                padding: 5px;
                }
                #columns {
                list-style: none;
                width: 100%;
                margin:20px 0; 
                }
                </style>
                

                The snippet call and surrounding markup, adjust for your docs etc.
                <ul id="columns">
                [!Ditto? &startID=`15` &summarize=`10` &total=`18` &tpl=`ditto_columns` &showarch=`0` &extenders=`summary` &trunc=`1`!]
                </ul>
                <br style="clear: left"/>

                The "ditto_columns" tpl chunk, again choose your own placeholders etc.
                <li>
                <h4>[+pagetitle+]</h4>
                [+summary+]
                <br/>
                [+link+]
                </li>



                FANTASTIC!
                just what I was looking for!
                  Everytime you use Flash ... a puppy dies .....
                  R.G Taylor