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.]
-
☆ A M B ☆
- 24,524 Posts
Go to the Settings tab for these resources and uncheck the "searchable" checkbox.
Wow... sorry for the stupid question.
-
☆ A M B ☆
- 24,524 Posts
No problem. There's a lot to the Manager interface to learn.
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?
-
☆ A M B ☆
- 24,524 Posts
Hm. Yes, that's a different matter altogether. I'm not sure how to go about that.
-
☆ 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
-
☆ 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.
-
☆ 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.