Help - Search - Members - Calendar
Full Version: search across system, not desired...
Movable Type Community Forum > Other Product Discussion > Bugs and Odd Behavior
MikeMc
I'm seeing a problem, I don't know if it's a bug rather than an oversight...

I have MT (latest version) installed on my system, no mods, installed in the cgi-bin of my root site.

i.e. in www.mysite.com/cgi-bin/

I have two blogs under it, blog1 and blog2 setup as redirects off the main domain... they're initially setup as :

www.mysite.com/blog1/  with a redir from blog1.mysite.com
and
www.mysite.com/blog2/  with a redir from blog2.mysite.com
(this is, of course, where the blog itself is stored)

if someone goes to blog1.mysite.com, and on the index page does a search, it does the search only across the current blog... no results come from the blog2.  This is the address in the titlebar at this point:

http://www.mysite.com/cgi-bin....h=searc

the only reference to which blog to search is the IncludeBlogs variable.  If I search again, right from this page, ALL blogs are included in the results, such as the search proggy didn't remember the IncludeBlogs variable.  The second set of results also come back in the other blogs template.

Is there a way to fix this, so that if someone searches off the index, then follows up with another search off the search page, they don't get results from all blogs?

Thanks..
stepan
Simply add the following to the form in your search template:
CODE
<input type="hidden" name="IncludeBlogs" value="<$MTBlogID$>" />

This is described in the manual.
MikeMc
oops.  Thanks, worked like a charm.
Mantle
I am having the same problem, but I'm stuck on how to add the line into the search template. I don't have a search template in the default install of MT 2.5, so I can't figure out how to insert the code. Is this changed in a newer release? I don't have control over the server so if this is changed I can convince my friend to update MT.
girlie
The search template isn't one listed in your Edit Template screen (if that's what you mean), it's an MT file located at search_templates/default.tmpl - you'd need to edit it with a text editor and FTP to your site.

(Or create a template module for it and link the template to the file so you can edit it from inside of MT - but your friend might not want you to edit the default template for all blogs, so you could create an Alternate Search Template instead.)
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.