We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8311
    • 25 Posts
    Hi All,
    I want to display a list of my news items in the right hand column of my page.
    Here is my ditto call: [[Ditto? &parents=`14` ]]
    It is displaying all of my News items under Resource"14", i just need to
    get rid of the default created by and created on markup that is coming with it.
    Just want the basic heading as a link to the page...

    Any help would be much appreciated!
      • 31912 MODX Staff
      • 95 Posts
      You want to set the &tpl in your ditto call to a chunk using only the placeholders you need to build the links. Take a look at this: http://wiki.modxcms.com/index.php/Ditto_Placeholders and see if it helps.
        • 8311
        • 25 Posts
        Thanks for that link...
        Sorry for being so dumb, but I just cant understand how I can physically use these attributes to style my ditto call?
        Can you give an example?
        If my call is [[Ditto? &parents=`14`]] where do i place the place holder [+title+]?

        This is my first time working with Ditto, so your patience with a noob is appreciated!!!
          • 31912 MODX Staff
          • 95 Posts
          You want to create a chunk in modx under the Elements » Manage Elements » Chunks. Use the placeholders within the chunk code–this will be repeated for each document. So if you named this chunk "customListing" and within the chunk you had:

          <h2><a href="[~[+id+]~]">[+pagetitle+]</a></h2>

          each listed document would have a link wrapping the page title contained within a h2 heading–you can change this to whatever markup you want to use for your layout. Your Ditto call would be: [[Ditto? &parents=`14` &tpl=`customListing`]] the tpl reference should be whatever you named your chunk.

          Hope that makes a bit more sense, it really is flexible once you get past the initial learning curve.
            • 8311
            • 25 Posts
            Awesome... works like a charm!
            Thats what learners need... a bit of a helping hand... not just what to do, but a start on how to do it too!
            Thanks for your help!