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

    I am about to start building a website that needs a news section.

    News items on the client’s existing (non MODx) site are currently listed in PDF format from most recent to least recent.

    It is possible that news items on the new site will be in pdf or html formats.

    Given we’d like to:
    + control the publish / unpublish dates of some news items (possibly all - I am not certain on that at this stage)
    + list the news items from most recent to least recent (and perhaps include an html heading for each relevant month to break up the list)
    + potentially also list the news items by sub categories such as marketing, financial etc
    + probably also provide an archive facility - anything say over 3 months is archived - the archives could be accessible by clicking on a rhs menu listing months for example.

    What’s the best way to include pdf’s as news items? Should I create a new "weblink" for each pdf or do I create a new blank page with no template for each pdf or is there another (best practice) way of working with pdf’s?

    And what’s the best to display the list of news items on screen - with ditto or wayfinder (or something else)?

    Any suggestions pointing in the right direction are much appreciated.

    Thanks in advance.
      Web design Adelaide
      http://gocreate.com.au
      • 7231
      • 4,205 Posts
      Use modx documents with a File type TV (Template Variable) for each PDF is the standard method. Then you would use Ditto with a custom tpl to display and sort as you want. Tip: create a template for documents, no need for any html, and add a redirect snippet to make the document inaccessible (or unpublish it since Ditto can read unpublished documents, I usually redirect to the error page).
        [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]
        • 21417
        • 486 Posts
        Hello dev_cw,

        Always to my rescue!

        I am sorry to waste your time but I’m not quite sure what you mean by "Use modx documents with a File type TV (Template Variable) for each PDF".

        How on earth do I do that?

        Any chance you could elaborate?

        Thank you kindly.

          Web design Adelaide
          http://gocreate.com.au
          • 7231
          • 4,205 Posts
          I’m not quite sure what you mean by "Use modx documents with a File type TV (Template Variable) for each PDF".
          Template Variables are one of the great things in MODx, basically they are custom fields that can be assigned a purpose like to represent an image, or a file or a URL, and you can attach an output widget to format the output. Here is some links to read:

          If you have not read this yet give it a browse, about halfway down there is an intro to Template Variables.
          http://nettuts.com/tutorials/other/working-with-a-content-management-framework-modx/

          Also check out the official TV documentation: http://modxcms.com/template-variables.html

          And there is also this good writeup on TV’s: http://modxcms.com/forums/index.php/topic,9989.0.html

          There are other snippets that can show file information like file size and file type (and even add a file type icon for the link). I have used one called FileDetails but don;t have the bookmark.

          Here is a site where i have a PDF archive.
            [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]
            • 21417
            • 486 Posts
            Hi again Shane,

            Thanks for clarifying that and for the links.

            They should point me in the right direction.

            Great Nettuts tutorial by the way!

            OK - so I build a TV for the pdfs and link them from a template and then use Ditto to list/sort etc - I will have a play next week.

            I’ve used TV’s before but not for this kind of thing - I use them to insert rhs column content, scripts into the head of some pages and the like

            Thanks again.

            Nick

              Web design Adelaide
              http://gocreate.com.au
              • 7231
              • 4,205 Posts
              You got the idea. And for date based archiving you may use Reflect as well. grin
                [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]
                • 25663 MODX Staff
                • 12,272 Posts
                Also keep in mind that Revo includes static resources as content types. That means any file on the filesystem in addition to the normal virtual web pages being generated from the DB.
                  Ryan Thrash, MODX Co-Founder
                  Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me