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

    I have followed the excellent guide here:

    http://wiki.modxcms.com/index.php/Tagged_blogging_with_Ditto

    ....to implement tagged blogging. Works a treat, but the only thing I cannot do is pull articles from all but one category. Here are my two ditto call:

    Latest News

    [!Ditto? &startID=`32` &tpl=`newsChunk` &summarize=`5` &hideFolders=`1` +createdon:date=`%d`+ &!]


    From the Notebook

    [!Ditto? &startID=`8` &tpl=`newsChunk` &summarize=`5` &hideFolders=`1` +createdon:date=`%d`+ &&descendentDepth=`2`!]


    If you take a look at my http://www.blend.uk.com you will see that I have a ’Latest News’ and a ’From the Notebook’ section. This is the above two ditto calls.

    The Latest News is set up as a tag, but I have to put the latest news within another folder called News for it to not show in the second ditto call. The problem with this is that the auto generated tag link points to: http://www.blend.uk.com/notebook/latestnews instead of http://www.blend.uk.com/notebook/news/latestnews.html.

    So my temporary fix of placing the news more than two levels deep (so that it doesn’t display on the front page) doesn’t work. This was a temporary measure so I could get the site live.... now I know it has flaws I would like to know how I can do it properly.

    Appreciate any help, sorry for the lengthy explanation.

    Lee





      http://www.blend.uk.com | Web Design by Blend
      • 18397
      • 3,250 Posts
      1. Make sure you are using Ditto 2.0.1.
      2. Remove +createdon:date=`%d`+ &&descendentDepth=`2`
      3. You can do what you describe using tag filtering. Keep all you documents in one folder and to:

      Show notebook entries:
      &tags=`Latest News` &tagMode=`removeAllTags`

      Show latest news:
      &tags=`Latest News` &tagMode=`onlyAllTags`
        • 17717
        • 433 Posts
        Hi Mark,

        I have tried the above.

        1) I moved the documents I had in containers, eg. [ Notebook/Business/Content #1 ] to the main Notebook folder, i.e. [ Notebook/Content #1 ], one thing I will say is that from the tutorial, I had the following ditto call on each container:

        [!Ditto? &startID=`8` &tpl=`dittoTpl` &tagData=`tvtags` &tagDelimiter=`,` &tagMode=`onlyTags` &tags=`Business`!]


        So moving them has got rid of the above, is this something that is not needed with the latest version of Ditto or have I read it wrong?

        2) I implemented the following ditto calls on my front page:


        Latest News

        [!Ditto? &startID=`8` &tpl=`newsChunk` &summarize=`5` &hideFolders=`1` &tags=`Latest News` &tagMode=`onlyAllTags`!]


        From the Notebook

        [!Ditto? &startID=`8` &tpl=`newsChunk` &summarize=`5` &hideFolders=`1` &tags=`Latest News` &tagMode=`removeAllTags`!]



        However, it seem to output the same (the first 5 documents in the Notebook container, Latest News and all.

        I see the theory behind the ditto calls above, in the latest news call it looks like we’re saying - "Show everything in notebook that has the tag Latest News".

        And in the Notebook call we are say - "Show everything in the notebook container expect for those articles tagged with with Latest News".

        It just doesn’t seem to work for me, is there anything I could have done wrong?

        Appreciate your help.

        Thanks
        Lee
          http://www.blend.uk.com | Web Design by Blend
          • 18397
          • 3,250 Posts
          You’ve removed &tagData=`tvtags` &tagDelimiter=`,` from your calls which tell Ditto where to find and how to split your tags. The filter won’t work without them.
            • 17717
            • 433 Posts
            Hi Mark,

            But those calls are in the containers of the categories, I moved the documents out of the categories and into the main notebook container, I thought that this is what you meant when you said:

            Keep all you documents in one folder

            So if I put them back how they were it should work.

            Sorry mate, will try that now.

            Lee
              http://www.blend.uk.com | Web Design by Blend
              • 17717
              • 433 Posts
              Hi Mark,

              I get the following message with my call to display all notebook items (minus the latest news):

              No documents found.

              I also get the above on my main notebook page where I list all the articles from all categories. Here is the snippet call on the main notebook page:

              [!Ditto? &startID=`8` &tpl=`ditto_articles` &hideFolders=`1` &displayArchive=`0`!]


              The latest news items on the front page display fine.

              Thanks
              Lee
                http://www.blend.uk.com | Web Design by Blend
                • 17717
                • 433 Posts
                Here is what I have:

                Homepage snippet call:

                Latest News

                [!Ditto? &startID=`32` &tpl=`newsChunk` &summarize=`5` &hideFolders=`1` &tags=`Latest News` &tagMode=`removeAllTags`!]


                From the Notebook

                [!Ditto? &startID=`8` &tpl=`newsChunk` &summarize=`5` &hideFolders=`1` &tags=`Latest News`&tagMode=`onlyAllTags`!]


                Here is my folder system:

                Notebook

                - Category #1
                - Content #1 (with category #1 tag ticked)
                - Content #2 (with category #2 tag ticked)

                - Category #2
                - Content #1 (with category #2 tag ticked)
                - Content #2 (with category #2 tag ticked)

                - Category #3
                - Content #1 (with category #3 tag ticked)
                - Content #2 (with category #3 tag ticked)

                I have a TV named tags with all the categories set up.

                Is there anything I might have missed?

                Thanks
                Lee
                  http://www.blend.uk.com | Web Design by Blend
                  • 33372
                  • 1,611 Posts
                  Have you tried adding &depth=2 (http://ditto.modxcms.com/files/snippet-ditto-php.html#depth)? And are your category folders unpublished? If so, then you may also need to add &seeThruUnpub=1.
                    "Things are not what they appear to be; nor are they otherwise." - Buddha

                    "Well, gee, Buddha - that wasn't very helpful..." - ZAP

                    Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
                    • 18397
                    • 3,250 Posts
                    The problem was solved with the following calls:

                    [!Ditto? &startID=`8` &depth=`3` &tpl=`newsChunk` &summarize=`5` &hideFolders=`1` &tagData=`tvtags` &tagDelimiter=`,` &tags=`Latest News` &tagMode=`onlyTags`!]
                    
                    [!Ditto? &startID=`8` &depth=`3` &tpl=`newsChunk` &summarize=`5` &hideFolders=`1` &tagData=`tvtags` &tagDelimiter=`,` &tags=`Latest News` &tagMode=`removeTags`!]