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

    I’m new to this CMS and I’d like to have that one for the next couple of years so, I have to question here for nice answers. I haven’t found solutions by searching the forum, so here we go:
    -How do I set up a News-site? This site should have the newest entry first and only showing 10 entries per page, also need pagination.
    -On my website there will appear Reviews for books, music, literature etc., this means I need a Reviews-Main-site but also listing the sub-categories on that page only. Automatically. Also the subcategory-pages should have 0-9 A B C etc. listing above and below the entries, only 10 per page and using pagination.
    -Also how do I usw Ditto? I haven’t found documentation telling me how to install that one, seems not running right now. I’m using the current version of the CMS.

    Thank you in advance !
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      If you had installed the Demo site content, you would see Ditto in action. Otherwise, this should answer all of your questions.

      http://ditto.modxcms.com/
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 23058
        • 17 Posts
        I read all of this before I post here, unfortunately it didn’t help me huh
          • 17883
          • 1,039 Posts
          Step by step:

          -How do I set up a News-site?

          Assuming your news folder has the ID 5:

          [!Ditto?parents=`5` (only docs in folder with ID 5)

          This site should have the newest entry first


          &sortBy=`createdon` &sortDir=`DESC` (sort by created date, direction descending. is standard setting, but for the sake of completeness)

          and only showing 10 entries per page

          &display=`10` (you can also use &summarize=`10`)

          also need pagination

          &paginate=`1`

          -On my website there will appear Reviews for books, music, literature etc., this means I need a Reviews-Main-site but also listing the sub-categories on that page only. Automatically.

          folder "Reviews" (e.g. ID 10), in that folder "books" (24), "music" (32) etc.

          All Reviews:
          [!Ditto?parents=`10` &depth=`3` (how many levels to search for docs)

          E.G. Music:

          [!Ditto?parents=`32` (only the music reviews)

          Also the subcategory-pages should have 0-9 A B C etc. listing above and below the entries, only 10 per page and using pagination.

          A-Z Listing: Seperate Snippet like http://www.modxcms.com/A-to-Z-Listing-523.html


            • 7231
            • 4,205 Posts
            Nice tutorial.
              [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

              Something is happening here, but you don't know what it is.
              Do you, Mr. Jones? - [bob dylan]
              • 23058
              • 17 Posts
              @MadeMyDay
              Thank you.

              Should I end each line with a closing ] because it begins with a [ ?
              And where do I edit or let’s say where do I have to put all these lines?
              I found the Ditto-folder but cannot find it files under modules and if I am not wrong the website says it is installed automatically with the new version, right?

              Sorry for all this questions, but I am new to this CMS and it is very different to all the others I used before.

              Also, is there any snippet, module whatever which uses Ajax and is able to put a link under a teaser-like text (news for example) and will load the "hidden" text after clicking on the link? I like this a lot but haven’t found it in the repository.
                • 25663 MODX Staff
                • 12,272 Posts
                The call should be all on one line:
                [!Ditto?parents=`5`&sortBy=`createdon` &sortDir=`DESC` &display=`10` &paginate=`1`!]


                Please note: those are backticks and not single-quotes.
                  Ryan Thrash, MODX Co-Founder
                  Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                  • 7231
                  • 4,205 Posts
                  And this code goes into the site template, you can hard code it or add it into the content area.
                    [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

                    Something is happening here, but you don't know what it is.
                    Do you, Mr. Jones? - [bob dylan]
                    • 28042 ☆ A M B ☆
                    • 24,524 Posts
                    Quote from: PersonalDemon at Nov 14, 2007, 08:23 AM

                    Also, is there any snippet, module whatever which uses Ajax and is able to put a link under a teaser-like text (news for example) and will load the "hidden" text after clicking on the link? I like this a lot but haven’t found it in the repository.
                    I use an ancient FAQ display snippet for this; I’ve modified it so much for different uses that I have no idea what the original was.
                    $resourceparent = isset($faqFolder) ? $faqFolder : $modx->documentIdentifier;
                    $output = "<script type=\"text/javascript\">
                    function expand(thistag) {
                      styleObj = document.getElementById(thistag).style;
                      if (styleObj.display=='none') {styleObj.display = '';}
                      else {styleObj.display = 'none';}
                    }
                    </script>";
                    
                    
                    $faq = $modx->getActiveChildren($faqFolder,'pagetitle', 'ASC', $fields=' id, pagetitle, content');
                    $limit=count($faq);
                    if($limit<1) {
                      $output .= 'No Questions Found<br />';
                    }
                    for ($y = 0; $y < $limit; $y++) {
                    $output .= '<ul><div onclick="expand('.$faq[$y]['id'].');" style="cursor:pointer;"><li><div class="faq">'.$faq[$y]['pagetitle'].'</div></li><div id="'.$faq[$y]['id'].'"  style="display:none">'.$faq[$y]['content'].'</div></div></ul>';
                    }
                    
                    return $output;
                      Studying MODX in the desert - http://sottwell.com
                      Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                      Join the Slack Community - http://modx.org
                      • 23058
                      • 17 Posts
                      Amazing! Thank you for all the helping posts. Another question, how do I display subfolders as links to the entries within the folders like:
                      Articles (main folder)
                      -subfolder 1
                      -subfolder 2

                      Subfolder should be displayed after clicking on "Articles" (menu-point), after clicking on the subfolders the articles (headlines only) should be displayed. The last one is the same as for the News someone post above, right?

                      Is there anything like a tag cloud snippet and for the seo friendly urls, can I make such a link to the articles like a article in the news for example it should look like this:
                      domain.com/news/your_headline.html

                      If there are subfolders like in articles then:
                      domain.com/articles/subfolder1/the_articles_headline.html

                      Is this possible?

                      Thanks again for all the posts, it helps me alot to handle this new promising CMS.