We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 48244
    • 23 Posts
    I have a group of resources (videos, photos) that have been placed in folders. Each of these resources populates a page via getResources to make a tidy list, but I don't want these resources to have individual pages, so I haven't created the page layout in the templates associated with them (videos, photos).

    I'd like a way for the user to be redirected away from these pages to the page they are listed on. The links appear if/when the user searches for them.

    I'm still learning the ins-and-outs of MODx, and appreciate all the help.

    PS - I'm using simple.search, so maybe exclude those resource IDs? If so, what is the tag I add to the simple.search form? [ed. note: markus5010 last edited this post 12 years, 1 month ago.]
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Go to the Settings tab for these resources and uncheck the "searchable" checkbox.
        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
        • 48244
        • 23 Posts
        Wow... sorry for the stupid question.
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          No problem. There's a lot to the Manager interface to learn.
            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
            • 48244
            • 23 Posts
            While that works, I think it will not provide the best user experience, as they will not return any search results. I'd like to see the search results, just linked to the page that has them all together, not the individual resources.

            Does this make sense?
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              Hm. Yes, that's a different matter altogether. I'm not sure how to go about that.
                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
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                It looks like you should be able to use a post-hook. If you want all children of resource X to be linked to resource Y, which contains your getResources call, it shouldn't be too difficult to do. How are these resources structured? Are the image/video resources always children of the resource with the getResources snippet call?

                I'm getting the general idea from this http://rtfm.modx.com/extras/revo/simplesearch/simplesearch.simplesearch/simplesearch.faceted-search-through-posthooks
                  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
                  • 48244
                  • 23 Posts
                  I have the child resources in folders: Manuals, Tech Data Sheets, etc. The main section page, in this case Downloads (13) displays all the child resources. Does this help?

                  Here is the getResources call for one of the sections on the Downloads page:

                  [[!getResources? 
                    &parents=`76` 
                    &tpl=`manual-item` 
                    &includeTVs=`1` 
                    &processTVs=`1`
                    &tvPrefix=``
                    &limit=`20`
                  ]]

                    • 28042 ☆ A M B ☆
                    • 24,524 Posts
                    I will see what I can do. Hopefully someone else has already had experience with this same thing and can come in with suggestions. I know I vaguely remember something along these lines some time ago, but I haven't been able to find anything.

                    I think from what I am seeing so far that I would use a post-hook and a context.

                    Since you don't ever display the video resources themselves, I would put them in their own context, 'downloads'. getResources has a &context property so each getResources call would fetch from the 'downloads' context.

                    The initial search would explicitly only search the 'web' context.

                    Then I would have a post-hook to search the 'downloads' context, using the ID of the Downloads resource (#13) as the target.

                    Basically I'm looking at that example of searching the Users, only applying it to Resources in a specified context.
                      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
                      • 28042 ☆ A M B ☆
                      • 24,524 Posts
                      You could just use a simple redirect snippet in your video-type resources - unless they're static resources of course. That would complicate things a bit.
                        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