We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 31624
    • 17 Posts
    Hello,
    I’ve read, read, and read again; archives in here, tutorials, etc and I am still a bit stumped at the best way to go about creating a very simple news area.


    I have a website that has a news page that will display all the news for that year (i may want to break it down by month if the news is more frequent) on the left column and on the right column will be a navigation that is just a list of years that will link to that particular year’s news. (eg. 2007, 2006, 2005, etc)

    First question:
    I currently have the left side setup as follows
    [[Ditto? &startID=`4` &summarize=`10` &tpl=`news_format` &dateFormat=`%d-%b-%y` &dateSource=`pub_date` &sortBy=`pub_date`]]

    This works ok for now, it is a big list of news articles on a page. Anything wrong with this code block & can it be improved at all? Is it formatted correctly for sorting? Also how should I be setting up the news articles, should I just be putting them all within the news container or should I also have a container for each year?

    I tried to use wayfinder to set up the side nav to filter by the year but it doesn’t seem to work correctly and I am finding good documentation very hard to come by. I used the example at http://ditto.modxcms.com/tutorials/wordpress-style-archives.html but Instead of just showing the years, it also has a nav item for the month and a nav item for the article with the title and none go to the correct pages.

    I would just like when you click on 2008 it populates the news container page with the 2008 articles and so forth for each year.

    Is there just a simple concrete example online or an easy to understand guide of how to sort by the year? I’m finding the lack of docs and good online examples a bit frustrating and this ends up taking hours instead of minutes like it should.



    Second Question:
    Regarding breadcrumbs, how will they work in conjunction with ditto and wayfinder, will they be able to show for example Home > News > 2008 News if you select the "2008 News" list item?


    Thanks!
      • 20413
      • 2,877 Posts
      Not to answer all your questions but you can do this in many ways.
      You can tag your articles and then categorize them by these tags. [ http://www.vimeo.com/929777?pg=embed&sec=929777 | http://wiki.modxcms.com/index.php/Tagged_blogging_with_Ditto#The_tagLinks_Snippet | http://wiki.modxcms.com/index.php/Category_Tagging_with_Ditto ]
      or

      You can use the reflect snippet to catogorize by month or year. [ http://ditto.modxcms.com/tutorials/wordpress-style-archives.html ]

      //I see you already saw the wordpress link. What modx version do you use? Do you have & in the url?
        @hawproductions | http://mrhaw.com/

        Infograph: MODX Advanced Install in 7 steps:
        http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

        Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
        http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
        • 31624
        • 17 Posts
        Thanks for the help.

        Yes I already saw that wordpress link, it seemed fairly close to what I was going after however that example pretty much just gives you a chunk of code but no explanation on how to modify it or what ever part does. It seemed as though everything was scattered around the website so I wasn’t sure what was what.

        I am using MODx version 0.9.6.1p2. My URL just shows the alias because I’m using friendly pages. I have uploaded a screenshot of how the nav looks, perhaps this will give a better idea of what is showing up. Also I notice that there is an end tag to a block of PHP code, "?>" at the top of my side nav that is getting inserted by this system somehow.


        Heres also a link to the graphic, this forum is making it smaller http://www.visim.com/myphotos/wordpressSideNav.gif

        Thanks
          • 27330
          • 884 Posts
          can you post a link for the doc?
            • 31624
            • 17 Posts
            I wish I could, I don’t have the live files up yet, they are still on my local dev server.

            Hmmm, I don’t suppose putting up the code I use on here would be any good eh?




            Looking at the links provided by MrHaw instead of using reflect would it make sense to use tags and instead of tag by words, tag by years, and then create a side nav that calls to the year tags? I’m trying to figure out what is the best to use in the long run and the best practice. I am a designer by trade and not a programmer so I am a bit self conscious of the code that I write wondering if it is the most efficient way of going about things.
              • 27330
              • 884 Posts
              yes you could use the tags for years as well. but if I were you I would have a separate container for each year then just ask ditto to show docs from specific year container when the user click the link.
                • 31624
                • 17 Posts
                What would be the simplest way to call the items in that particular container? I guess more of what I am asking is how do you manually create a link that will populate the area by the years, or is there an automated way that would be best.

                Thanks
                  • 27330
                  • 884 Posts
                  I would think a nice way would be something like mootools accordion with the years as links that open the DIV with the ditto calls using the wordpress example. just remember to use &id in your ditto calls.
                    • 31624
                    • 17 Posts
                    Can someone please tell me what needs to be added to this Ditto Call to sort by a specific year? Can I somehow just add to this code block that I only want 2008 to show up?

                    [!Ditto? &startID=`76` &summarize=`10` &tpl=`news_format` &dateFormat=`%d-%b-%y` &dateSource=`pub_date` &sortBy=`pub_date` !]




                    I’ve been going over these pages for about the millionth time and without working examples or clear documentation I have no clue where to begin http://ditto.modxcms.com/files/assets/snippets/ditto/extenders/dateFilter-extender-inc-php.html#month http://modxcms.com/ditto_parameters.html


                    Thanks
                      • 20413
                      • 2,877 Posts
                      There are 3 approaches here (I can see):

                      ---> Use ditto with reflect snippet.

                      ---> Use ditto with TV-tags e.g. 2008, 2009, 2010...

                      ---> Post blog/articles in to different folders/containers named 2008, 2009...
                      and have ditto just call thoose containers. (So when year is over you change to post in the new container)

                      What you wanna do? smiley
                        @hawproductions | http://mrhaw.com/

                        Infograph: MODX Advanced Install in 7 steps:
                        http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

                        Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
                        http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower