On AjaxSearch and FlexSearchForm, as well as other search snippets sometimes the search returns a page which has a "blank" template. So, when you click on the search results you get a blank page with the content on it.
What I’d like to know/do is:
+ If the page template is blank, (blank) or 0 then go up the chain until you find a parent that has a non-blank template
+ Return the non-blank template ID
+ Use this as the document link
Or, if its been solved another way, that’d be great!
Maybe add a redirect snippet to redirect to parent. there is a snippet in the repository named phiRedict (or something like that) that has some nice redirect features.
I usually make my MODx folders weblinks that link to the parent document or first child document. I haven’t tested how the behavior works with Search snippets as I use Google Custom Search but weblinks behave just like HTTP 301 Redirects so it shouldn’t be a problem.
Attached is a sample of the hierarchy of one of my sites showing sort of what I mean (document 103 is a weblink to document 6).
That’s another good solution too. However, if you’re children are sitting in blank templates (usually used as Ditto templates) then you still have the same problem.
I like that idea to, the results are the same but the interface is a bit more straight forward.