search results pulling wrong template
I just bought Low Search and am having an issue:
I'm using Low Search in Expression Engine. Low Search works fine if the result page is just a single segment. If there are two Segments or more, it does not pull the correct template. It pulls the index.html template from the Template group and ignores the the channel entry.
This does not work for Return_page:
{exp:low_search:form result_page="applications/{segment_2}" query="{segment_3}" collection="application_page" smart_field_search="yes"}
You can see it at work here:http://cohr-dev-ee01.azurewebsites.ne...
Also, my search form and results are on the same page if that matters.
Replies
Low 24 Sep 2015 06:34
Not sure if this is a Low Search issue. If I take a look at your example page, this URL gives me the same page as the search results page:
http://cohr-dev-ee01.azurewebsites.ne...
And that's just adding something random to the end of the URI.
Do you have any other add-ons installed that change the regular template routing? Perhaps enabling the template debugger and taking a look at the debug info will shed some light as to why EE is routing to the wrong template.
RobertGranlund 24 Sep 2015 18:13
What would I look for in the template debugger? What do you think could be causing a re-routing issue?
Low 24 Sep 2015 18:39
You should be able to see which template is fetched in the debugger.
I'm not sure what causes it. LS just loads up the page based on the result_page and encoded query. All of that works fine.
Are you using something like Structure or template routes?
RobertGranlund 24 Sep 2015 19:11
Detour Pro which handles re-directs. The interesting thing is, is that if there is a single segmentt in the result page, it's fine but if there is more than one it breaks. Could it be my mode re-write for the Windows Azure IIS?
[code]
[/code]
Low 24 Sep 2015 19:17
Yes, a mod rewrite could be the cause. Can't see the code you posted.
You can try and disable it, and then load up the search results page with /index.php/ in there so it loads.
RobertGranlund 24 Sep 2015 20:20
is there an email that I send the rewrite file for IIS? I would like to keep the index.php off of the site url if possible.
Low 24 Sep 2015 20:22
It's just to test if that actually is the issue. You can restore it after testing.
For email: http://gotolow.com/contact
RobertGranlund 24 Sep 2015 20:22
Well, when I disable the index.php re-write it still does it.
Low 24 Sep 2015 20:23
I'll need to take a look myself. Please send SuperAdmin login credentials to hi at gotolow dot com if you can.
RobertGranlund 24 Sep 2015 20:35
They have been sent. Thanks in advance, I'm sure it is something simple.
Low 24 Sep 2015 20:38
Haven't seen anything come in yet. Can you verify?
RobertGranlund 24 Sep 2015 20:55
typo, just sent again.
Low 24 Sep 2015 21:27
I've taken a look around. Rather than changing things in the templates -- they're quite intricate -- I've seen some things you should look at:
- The URI /applications/graphic-arts-display belong to a Page from the Pages module. That means that for that URI, a specific entry will be loaded. If the URI doesn't match -- like when there's a another segment after it, eg. the encoded query -- EE's native template renderer kicks in, meaning that instead of loading the applications/group template (for the Page), it will load the applications/index template. This is all native EE functionality, and has nothing to do with the workings of Low Search.
That said, here are some more pointers:
- Make sure the query="" parameter of the low_search:results tag always points to the correct segment.
- Having {segment_1}/{segment_2} in the Low Search extension setting won't work. Settings don't accept template variables as values.
- Don't use any filter-specific parameters on the low_search:form tag (like collection="application_page" smart_field_search="yes"). That won't do anything. Instead, set them on the Results tag.
- Use more dynamic="no" in your channel:entries tags for content that's not meant to be dynamic. That might cause EE to display (or not display) content opposite of what you expect.
All in all, I don't have any reason to believe LS isn't working as intended. It's a matter of implementation.
RobertGranlund 24 Sep 2015 21:46
Do you have any pointers on fixing this;
- The URI /applications/graphic-arts-display belong to a Page from the Pages module. That means that for that URI, a specific entry will be loaded. If the URI doesn't match -- like when there's a another segment after it, eg. the encoded query -- EE's native template renderer kicks in, meaning that instead of loading the applications/group template (for the Page), it will load the applications/index template. This is all native EE functionality, and has nothing to do with the workings of Low Search.
Do I re-save them through content and delete them from the Page Module? As you can see there are a lot of pages loaded through the pages module and am not sure how to fix that.
Low 24 Sep 2015 21:51
Personally, I'd avoid the Pages module and maybe look into template routes. However, how you approach this is up to you and falls outside the scope of Low Search support, I'm afraid.
RobertGranlund 24 Sep 2015 22:12
I really appreciate all of your help. Maybe there can be a place for this in your documentation? Again, thanks so much for your time and help.
The client is the second largest Laser Beam Seller in the world, so hopefully the search functionality will look good to the higher ups.
RobertGranlund 24 Sep 2015 23:37
One last question, from looking at our installation do you see why the GET Method does not work?
Also, I'm not sure how to write the Results page when it the segment_2 can be one of a hundred different segment titles.
Low 25 Sep 2015 07:25
Can't tell from the installation, no. It's probably a server issue, like having the question mark in your htaccess when removing the index.php. See the notes here http://gotolow.com/addons/low-search/...