We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18339
    • 14 Posts
    Hello there. I’m relatively new to MODx but I’m loving it. In a few short weeks I’ve been able to do a lot more than when I tried Drupal or Joomla. This is the way it should be.

    One question though: I do appreciate the rapid, straightforward way I can create pages, and especially how I can create a sensible hierarchy. But is everything a "page"? Meaning, if I want to, for example, have a list of mp3s (legal of course, I’m a musician and former radio guy) that would display in a list on a page, I would create that "list" by making a page for each mp3, with a TV to hold the MP3, and use Ditto to create the list? I haven’t touched Ditto yet, but what little I saw of it when I was researching MODx made it look perfect.

    If this is the case, is there a way to restrict visitors from going specifically to the physical "page" that I make for a particular mp3? For example if I want it to only show in a list.

    Other than that, MODx is everything I need it to be, which is probably the first time I’ve ever said that about a CMS (or CMF). Thanks for all your hard work.

    -mark
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      The whole purpose of Ditto is to generate lists of links to pages. It would be possible to have it generate lists without links using a custom tpl chunk, have the documents unpublished and use the parameter &showPublishedOnly=0 for Ditto to list them anyway. If they are unpublished then they cannot be accessed directly. You could also use a filter in the Ditto call to only list unpublished documents.

      You could also use a separate table (or even a text file) for storing your lists and use a custom snippet, or a TV with @SELECT or @FILE binding for displaying the list.
        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
        • 23571
        • 223 Posts
        This is what I use in similiar situations where I need to automatically populate lists of directory contents:
        http://www.gregorysmart.com/2008/11/18/documentman-modx-document-management-snippet/
        and another:
        http://www.gregorysmart.com/2009/02/27/modx-documentman-and-jquery-portfolio/
          • 18339
          • 14 Posts
          Quote from: pleth at Jul 03, 2009, 10:38 PM

          This is what I use in similiar situations where I need to automatically populate lists of directory contents:
          http://www.gregorysmart.com/2008/11/18/documentman-modx-document-management-snippet/
          and another:
          http://www.gregorysmart.com/2009/02/27/modx-documentman-and-jquery-portfolio/


          These snippets will actually help me when I get to the image-gallery stage of my site (I tend not to like trying to integrate some gallery software into a CMS/CMF), but just so I’m clear: I don’t *mind* inputting this data into MODx, I just wanted to confirm that the "page" paradigm is for everything, and then through options and Ditto you make it behave differently. I may actually want these things to have pages of their own someday, but for now having them in a list with a 2- or 3-line description will be fine.
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            Then yes, using documents and Ditto is what you’re looking for. Ditto is extremely flexible http://ditto.modxcms.com/

            Consider that a document is nothing more than an entry in the site_content table. It has a number of fields for each entry. Template Variables (TVs) are a way of adding extra, custom data for each entry. So while it’s best not to go overboard on using it as a basic data store (i.e. storing several thousand entries), it works just fine.

            For example, I use it in an "Our Employees" section of one site, using Ditto to aggregate the employee pages and some Javascript to open/close the bio and image of each employee as the name is clicked on. The client can easily add/remove employees, and edit the bios and update the images since it’s all just documents.

            On the other hand, for the same site, in managing a words-and-phrases translation terminology database involving several thousand phrases in several languages, I use custom tables and a fancy AJAX grid for display, with a custom Manager module also using an AJAX grid for management.
              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
              • 7231
              • 4,205 Posts
              I have always thought that MODx needed a way to make ’documents’ not be ’pages’ and be for data only. Until that happens (not sure if this is a feature in Revo or not) what i do is create a template for data and include a redirect snippet in the content so that if anyone were to load the ’page’ that it would redirect to the parent (or any other place) rather than loading the document page.

              Another way is to have the documents unpublished and use ditto with &showPublishedOnly parameter to show unpublished documents in te list (an unpublished document is not available to the public but ditto can use it).
                [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]
                • 27708 MODX Staff
                • 2,502 Posts
                In Revolution documents are but one type of content resource. You can have various types of resources such as static HTML documents and more.

                That being said, in Evolution and its predecessors what I do is to create a specific template for say an mp3 and then when creating the document use a custom content type for the file type to send the correct mime type. So sure, they are called documents but they are not anything more than container that allow you to add information to the content too.

                Hope this makes sense.
                  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