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

    I have successfully followed the instructions for tagged navigation using the docTags template variable.

    I used this to create a "related pages" list using a Ditto call - this lists all pages sharing the same tag(s) as the page currently being viewed. Unfortunately, the current page is included in the list created by Ditto.

    How do I exclude the currently viewed page from this list?

    If it helps, my Ditto call is:

    [!Ditto? &parents=`70` &tpl=`DittoTemplate2` &depth=`0` &tagData=`docTags` &tags=`[*docTags*]` &tagDelimiter=`,` !]


    Thanks in advance

    Lee
      • 4310
      • 2,310 Posts
      I haven’t used this but you could try the &filter parameter.
      Something along the lines of:
      &filter=`[*id*]` 
        • 3707
        • 241 Posts
        The filter parameter will do the job
        &filter=`id,[*id*],2`

        Where id is the field, [*id*] is the value of the current page and 2 is the mode, in this case meaning ==. You can check the ditto docs for more info on this http://ditto.modxcms.com/files/snippet-ditto-php.html#filter
          • 4310
          • 2,310 Posts
          @bob1000
          Thanks for explaining it fully.
            • 16834
            • 93 Posts
            brilliant, thank you both very much.

            L