We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24904
    • 79 Posts
    How would you implement news into modx?

    example
    frontpage with news block - you have short summary of recent news posted, user can click "read more" to view the entire news article (this directs the user to the news page).
    news page - contains list of news items, user can click on each news item to read the full article.

    is there already a plugin to do this?
      • 25663 MODX Staff
      • 12,272 Posts
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 24904
        • 79 Posts
        thanks
        I tired newspublisher
        but dont know what im meant to do?
        I inserted [[newspublisher]] I published a news, but dont know where it went either? or why its not showing hmm

          • 27708 MODX Staff
          • 2,502 Posts
          Try this: http://wiki.modxcms.com/index.php/Basic_Blog

          This is basically what you want to do.

          Newspublisher is to create documents.
          Ditto will display your documents (your brief news item with the "read more" link to the document.)

          The documents created by Newspublisher will show up in the document tree. You should tell it what parent under which you would like them to appear.

          You will then tell Ditto to look in that dir (or dirs) for documents and display them.

          You use the ditto templates to customize the look of your news display. (Use the link that Ryan left you to find out how to do that.)

          Hope this helps.

          For a completed example (live) you can look at http://www.nqnh.ca the news items on the left are using this exact method.

          Cheers,

          Jay
            Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub
            • 24904
            • 79 Posts
            thats alot guys, will try this smiley
              • 24904
              • 79 Posts
              [+date+] seems to format the date as "14-Dec-07 17:29" can I format to "December 14, 2007"
                • 7231
                • 4,205 Posts
                &dateFormat
                Purpose

                Format the [+date+] placeholder in human readable form
                Options

                Any PHP valid strftime option

                Use the &dateFormat to structure the date using strftime() structure. This should work &dateFormat=`%B %e, %Y`

                http://www.php.net/strftime
                  [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]
                  • 24904
                  • 79 Posts
                  hi dev_cw

                  im confused, what would I insert in the html document to make it work?
                    • 27708 MODX Staff
                    • 2,502 Posts
                    In your Ditto Call you would add the &dateFormat parameter to your call as below:

                    [[Ditto? &dateFormat=`%B  %e,  %Y`]]
                    


                    Obviously you would have your other parameters in the call but this at least shows you how to do it. This will only work on the Ditto content.

                    Hope this helps.

                    Jay
                      Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub
                      • 7231
                      • 4,205 Posts
                      As smashingred stated, just add it to the Ditto call and the [+date+] placeholder will follow the specified format.
                        [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]