We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23299
    • 1,161 Posts
    I am a long time MODx user but have not built anything in a long time. I am very rusty.

    I am building a very simple user friendly site. I want to use getResources to aggregate a small series of articles. I have the system working.

    One thing I want to do is create a template for the article posts themselves. This way I can add extra CSS and content common to each page like horizontal rules and a "explore more articles" link that sends the reader back to the parent getResources page. How do I do this?

    Thanks!
      • 10208 ☆ A M B ☆
      • 1,780 Posts
      Have you considered using Revolution and the Articles package? It's all set up for doing just what you're looking to do.



        Frogabog- MODX Websites in Portland Oregon
        "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
        Having server issues? These guys have MODX Hosting perfected - SkyToaster
        • 23299
        • 1,161 Posts
        I am using Revo.

        I am used to using Articles but I want this to be super simple for this site. No resent posts links, no comments, no tags, no dates, etc...

        I thought using the basic getResources snippet might work. But I want to use a styled template for the actual post pages that makes it super direct and clean for the site owner...
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          You can assign any template you like to the individual post pages, whether you are using Articles or not.
            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
            • 10208 ☆ A M B ☆
            • 1,780 Posts
            The getResources snippet works just fine for articles. In fact, I have one site that has to use it, because the regular articles and comments placeholders simply don't work. getResources is my bandaid solution.

            [[getResources?
              &parents=`14`
              &tpl=`ArticleRowTpl`
              &showHidden=`1`
              &limit=`8`
            ]]
            [[+paging]]


              Frogabog- MODX Websites in Portland Oregon
              "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
              Having server issues? These guys have MODX Hosting perfected - SkyToaster
              • 23299
              • 1,161 Posts
              Thanks,

              I have a template working for the parent page. What I need though is a template for the actual child pages. I want specific extra content to appear on each child page automatically without the site owner having to add it. The unique content for each post will be created using TinyMCE by the site owner.

              I guess what I am not wrapping my head around is where do I add the child page template? [ed. note: Photowebmax last edited this post 13 years, 11 months ago.]
                • 10208 ☆ A M B ☆
                • 1,780 Posts
                In the elements tab, under templates. Just create it and put it in whatever category you like (or none). At that point, it is available for all resources including Articles.
                  Frogabog- MODX Websites in Portland Oregon
                  "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
                  Having server issues? These guys have MODX Hosting perfected - SkyToaster
                  • 23299
                  • 1,161 Posts
                  That is what I just did. This should work fine. The only issue is that the site owner will HAVE to remember to choose the correct template when creating child pages that uses the getResources system.

                  I copied the main base template I built for the site overall and then just added the extra specific content above and below the MODx Content placeholder for the child post pages. This works fine.

                  I thought there might be a way of adding a small template to the getResources snippet call that would add the extra content to all the expanded child pages without adding it to the parent getResources container index page. This way the owner would not have pick through page templates when creating different pages in the site. The owner has never had a site before and is quite intimidated by the whole process. I am attempting to make this as easy and simple as possible. The fewer switches that have to be flicked the better...

                  Thanks! [ed. note: Photowebmax last edited this post 13 years, 11 months ago.]
                    • 28042 ☆ A M B ☆
                    • 24,524 Posts
                    You can create a form customization set to give the children of a specific resource a specific template https://forums.modx.com/thread/14384/children-inherit-different-template-from-parent-revo
                      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
                      • 23299
                      • 1,161 Posts
                      Thanks Susan, that looks interesting!

                      Max