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

    I would like to have categories for my news. I’ve made a search but the only topic i found was about newslisting. http://modxcms.com/forums/index.php/topic,4621.0.html
    It’s exactly what i want to do...

    Anyone has already hack ditto like this ?
      :: RiderCrazy.Com :: Server@Home - [WIP] En cours de transition vers MODx
      • 18397
      • 3,250 Posts
      I’m sorry, I don’t speak French so I have no idea what that topic says.

      If you are referring to tagging, Ditto natively supports this as of version 1.0.2.
        • 6726
        • 7,075 Posts
        Well Mark if I am not mistaken this was a hack to NewsListing that made it possible to retrieve the parent id and set a placeholder idparent, so that you have a pseudo-category link which looks like this <a href="[~[+idparent+]~]">[+titleparent+]</a>

        I don’t think this is really needed, could be accomplished many different ways without no hack...
          .: COO - Commerce Guys - Community Driven Innovation :.


          MODx est l&#39;outil id
          • 25059
          • 47 Posts
          Quote from: davidm at Aug 19, 2006, 02:17 PM
          I don’t think this is really needed, could be accomplished many different ways without no hack...
          And the answer is ?

          (merci pour ton aide davidm/thanks for your help :p)
            :: RiderCrazy.Com :: Server@Home - [WIP] En cours de transition vers MODx
            • 18397
            • 3,250 Posts
            You could just use [~[+parent+]~] for the URL and my getDoc snippet like so [[getDoc?id=[+parent+] &field=`pagetitle`]] for the title.
              • 25059
              • 47 Posts
              Great... it works perfectly ! Thanks mark.
              I didn’t know the getDoc snippet before... not so big but very usefull wink
                :: RiderCrazy.Com :: Server@Home - [WIP] En cours de transition vers MODx
                • 12844
                • 59 Posts
                I’ve a feeling this topic holds the answer to my own question, but I don’t know how to use the information already supplied (I’m a new MODx user struggling to keep my head above water).

                At http://euro-racing.net/ you’ll find the beginnings of a news section on the home page.

                There are three folders within the home page folder (viewable in News menu on right). These are my news categories.

                There are three sample posts, one within each news category. There is also a post stating that I am building a news section - this resides right within the home/news page.

                I’d like to find out how to do the following:

                • Call Ditto from within the home/news page to have it display only posts, not folders.
                • Call Ditto from within each of the category folder pages to have it display only the relevant posts within each respective category. (I realise I could just change $startID three times for this, but that seems somewhat contrived and undynamic.)
                Quote from: Mark at Aug 19, 2006, 04:32 PM

                You could just use [~[+parent+]~] for the URL and my getDoc snippet like so [[getDoc?id=[+parent+] &field=`pagetitle`]] for the title.
                I think this could be what I need, but I don’t understand what it does, how it does it and where it goes.

                Many thanks.
                  • 11975
                  • 2,542 Posts
                  Hi,

                  there is as usual with modx several ways to achieve what you are asking.

                  for instance :
                  make Two chunk with ditto call inside and one TV

                  in the first one:
                  Ditto? &startID= the ids of your categories  folder separated with comma

                  in the seconde:
                  Ditto? &startID=[*id*]

                  in the TV(select)single
                  None==||displayAll=={{chunk1}}||displayCurrent=={{chunk2}}

                  Don’t forget to attach your TV to your template and insert [*TV*] to display his content

                  Then you set the tv to displayAll for the homepage and displayCurrent  for the folder

                  :-)
                    Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
                    • 7923
                    • 4,213 Posts
                    Quote from: ImpelGD at Sep 05, 2006, 12:02 PM

                    Call Ditto from within the home/news page to have it display only posts, not folders.
                    You mean that show documents that are only in the home/news document and nothing below that? add &descendentDepth=`1` and &hideFolders=`1` parameters to your snippet call.

                    Quote from: ImpelGD at Sep 05, 2006, 12:02 PM

                    Call Ditto from within each of the category folder pages to have it display only the relevant posts within each respective category.
                    Do you mean that when user clicks forexample "ERG race results", it would show news items under that folder? In that case, in each of those folder documents, have a ditto call without the &startID parameter, it will then use the current document.



                      "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                      • 12844
                      • 59 Posts
                      Aha... thank you very much guys. doze’s simple technique (why didn’t I see that hideFolders attribute in the pdf?) works great, but I will also try heliotrope’s TV method as I haven’t used them before and need to see how they work.

                      Thanks again. smiley