We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30703
    • 51 Posts
    I’ve seen this option before somewhere but for some reason I can’t seem to find it anywhere now! sad

    So where can I select the default template for resources?
    Sorry for the silly question but I’ve been looking for a good couple of hours now! lol

      Tom Dyer

      Designer/Animator/Web Developer - England, UK.
      http://www.bespokepixels.co.uk
      • 28215
      • 4,149 Posts
      System -> System Settings. Search for ’default_template’.
        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
        • 30703
        • 51 Posts
        Thanks, but it doesn’t appear to be there, is it possible that I removed this by accident? :O
        I have looked on another MODx installation and re-created it by using the same settings and this seems to work (if I enter the template ID manually).

        The only problem with this is that I couldn’t replicate the Field-Type of "modx-combo-template" and Description of "setting_default_template_desc" - is there a way to get it back properly?

          Tom Dyer

          Designer/Animator/Web Developer - England, UK.
          http://www.bespokepixels.co.uk
          • 14877
          • 110 Posts
          I noticed something very nice that I haven’t seen documented. I’m assuming this is NOT a co-incidence:

          If you set the template on a resource, then the default template when you create children of that resource (with "Create a document here") is the same as the template set for the parent. It’s logical and I find it more useful than any global template default. The point is that (at least for me), my site organizations tend to be reflected in how pages are displayed. For example, if I have a "Special Interests" section of a web site, there is one page for that area and then a bunch of children pages (resources), each being a "Special Interest" and using the same template.

          [Added]

          I forgot to mention that I often create resources that are hidden from menus, solely to be used as the parent (i.e. container) for other resources. An example is that I have a parent resource under which I create all my CSS resources. It has the benefit of keeping the resource tree neatly organized and easy to navigate.
            __________________
            JRG
            • 30703
            • 51 Posts
            Yeah I agree that it’s quite handy in most cases, except my current project.

            I would like container pages (these use a template to redirect to the first child)
            and the sub-pages (which contain video content)

            I would ideally like the user to be able to navigate through all the video pages, using the container pages as a kind of "Category" label.
            Is there a way to display the next page, even when the ’next’ page sits within a different container?

              Tom Dyer

              Designer/Animator/Web Developer - England, UK.
              http://www.bespokepixels.co.uk
              • 25663 MODX Staff
              • 12,272 Posts
              @trymedo ... couldn’t you just use a getResources call on the parent container?
                Ryan Thrash, MODX Co-Founder
                Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                • 30703
                • 51 Posts
                @rthrash

                I don’t think so... you see I have my site structure as follows:

                - Category 1
                - Video1 (category 1)
                - Video2 (category 1)
                - Video3 (category 1)
                - Category 2
                - Video1 (category 2)
                - Video2 (category 2)
                - Video3 (category 2)
                - Video4 (category 2)
                - Video5 (category 2)

                The categories use a template that redirects to the first child.
                I would like the video pages to use a single template that links to prev and next videos. I have already managed this with the BasicNav snippet but I would also like Video3 (category 1) to link to Video1(category 2), and visa-versa.


                I love MODx and so far it’s been an absolute dream, but for this, my PHP skills aren’t up to the job yet sad

                  Tom Dyer

                  Designer/Animator/Web Developer - England, UK.
                  http://www.bespokepixels.co.uk
                  • 14877
                  • 110 Posts
                  I don’t understand. If each of your Categories is a SYMLINK to the first child, then the template isn’t used and you can set it to be whatever template you want as a default for its children.

                  I’ve used symlinks in exactly this way.
                    __________________
                    JRG
                    • 14877
                    • 110 Posts
                    Ah, a doubly-linked list smiley

                    Do you have a small handful of videos in each category or so many that you use an automated process to add them?

                    If it’s a small number, then you could set up "prev-resource" and "next-resource" template variables and simply set them (i.e. value is an ID) on each video. The template’s Previous and Next "buttons" then simply turn the IDs into links.

                    You could avoid having to have special handling for the first and last video in a category by turning the linked list into a a circular list (i.e. the "previous" of the first is the last and the "next" of the last is the first).

                    I haven’t got sufficiently proficient/knowledgeable about MODX to be able to answer confidently, but I suspect code could be put in place to handle the setting of the TVs automatically.
                      __________________
                      JRG
                      • 30703
                      • 51 Posts
                      I’m not sure I understand what you mean by a circular list?

                      I’m trying to avoid leaving any linking to the client, they simply want to be able to upload videos, add a title and description, then publish to a category. The rest (ie the linking) should be automated.

                      I think they will be happy enough for the prev/next links to be within the current category for now, but I’m certain I’ll need a solution for this at some point.

                        Tom Dyer

                        Designer/Animator/Web Developer - England, UK.
                        http://www.bespokepixels.co.uk