ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

How to direct search results ...

October 29, 2007 11:08pm

Subscribe [1]
  • #1 / Oct 29, 2007 11:08pm

    doclalor

    1 posts

    To use EE search, do I have to use a dedicated group/template to display search results (in the pattern of the default, ‘search/results’ ...)?

    Every other page on the site I’m building utilizes the same main index.php template (the content varies by means of conditionals and embeds). But I have not been able to get SEARCH results to display that way. When I try to embed results in my main template group, I get “no results” errors (for searches that do have results if I use the dedicated search/results pages).

    I don’t mind too much creating such a dedicated page for search results if that’s required (it’s just a matter of re-embedding header, side-bars, footer, etc.). I just thought there had to be a way to allow my main index.php to parse the url and when segment_2==“search” and segment_3==“results” display those display results!

    I know I am missing something. What is it?

  • #2 / Nov 01, 2007 1:01am

    Lisa Wess

    20502 posts

    There are special tags for showing the results of a search; you can’t use the weblog entries tag for it (though many of the same variables are available), so I would, indeed, recommend a dedicated results page.

    There’s really no reason, with embeds and all, to get really worried about having one template do everything; you sacrifice a lot of flexibility doing that and end up with an overly complicated template that has to do a lot of processing to figure out what you want. =)

  • #3 / Nov 01, 2007 6:08pm

    doclalor

    1 posts

    Thanks, Lisa. It’s fine. I’ll use a dedicated page!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases