We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32645
    • 377 Posts
    We have a website which has the following categories:

    * News
    * Health
    * Film
    ...etc

    Each category has articles within them.

    The articles are displayed on an "articles page" which lists all articles in date descending order, so the most recent article appears highest.

    But, I’m confused as to how to do the structure with Ditto and MODx.

    Option 1
    ========

    Create physical pages that act as "containers/folders" for each of the above categories and articles that appear under these "containers".

    Problem:

    I need to output the contents of each folder in date descending order and currently Ditto is not showing the actual child articles.


    Option 2
    ========

    Use Template Variable checkbox for the categories.

    All articles appear under the ’article page’ when you press the +/- button in the CMS/Manager.

    Problem:

    When there are loads of articles the manager will take forever to load.


    Question
    ========

    What is the correct way to structure categories and child articles, and display them on a "article" page where Ditto will output the articles in date descending order, but without sacrificing the speed of the manager?

    Many thanks.

      • 16278
      • 928 Posts
      Your Option 1 should work fine using the &parents parameter - e.g. if you have news under folder 3, health under folder 7, film under folder 9 you would include &parents=`3,7,9` in your Ditto call, and the default sort order (createdon descending), or set the sort order with &orderBy=`datefield DESC` if you are using something else.
      smiley KP
      Ditto info and examples at http://www.pogwatch.com/ditto.html

        • 32645
        • 377 Posts
        Hi there.

        Thanks for your answer! I was after an example, and that helped a lot!

        A related issue I have is whether it’s better to have a Blog entry page/form that stores everything in template variables, or to have individual pages?

        IE:
        Use MODx’s power to create a page that has a form where the user can basically add/edit/delete blog articles which then display on another page.

        That way you only ever show 2 pages for the Blog style articles on the manager (the editor and the article viewer).
          • 16278
          • 928 Posts
          If it’s front-end document management you are looking for, you could do worse than try my pkBlog package (repository version is out of date, you can download it from Pogwatch or go to the In Development forum for version 1.4.1).

          The sample setup gives you a web form for entering items and a control panel for the editor to review status, delete and reload for editing after publication. If you make your tagging template variable a radio button set rather than checkboxes, you can use pkBlog to file items in different folders and then use Ditto to list the items without further reference to tags.

          Small warning: if you are still finding your way around the MODx jargon, you may find it a little complex at first. I hope installation has become easier as I’ve tested successive versions in different environments and updated the instructions.

          You might also want to review your thoughts about Option 2 (using manager logins for articles). To me, the Quick Manager is the greatest improvement from Evolution 0.9.6.3 to 1.0, it makes it so easy to create and update items from the front end. You could probably craft a comfortable environment for your users together with the ManagerManager plugin, without going into form design and so on.

          grin KP
            • 32645
            • 377 Posts
            Thanks for your help. I’ve been able to create the Ditto structure so that it outputs all the children content in one go, all date descending.

            My main concern was that perhaps in 3 years time there’s going to be loads of articles and the manager would take time to load.

            I will investigate the pkBlog plugin/snippet; but for now I’ll be happy with the current system.