I have a medical group site, and within that site is a book (made up of many individual pages). On the regular site pages, I want to be able to search the entire site - including the book. On the book pages, I want the search module to only search the book pages. Is this possible? It's not clear to me if modules="" would do it, as I'm not really dealing with modules.
Thank you!
Donia
Search Module Searching Different Parts of Sites
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
Re: Search Module Searching Different Parts of Sites
The search module doesn't handle this at the moment..... there is currently a single tag to include in page content to exclude that page from ALL searches.
sorry.
sorry.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Re: Search Module Searching Different Parts of Sites
I'd like to add a new parameter called book that if present, indicates that I'm doing a book search and to process accordingly. I have 6 templates, and so I want to only include 1 of them in the book search. I've posted what I've done below. The debugging I've done would indicate that the book parameter is empty. I just don't know why.
Thank you!
Donia
In lang/en_US.php:
In Search.module.php:
in function SetParameters()
in function DoEvent - case 'EditTemplatePost': (I've add the to the appropriate templates.)
Thank you!
Donia
In lang/en_US.php:
Code: Select all
$lang['param_book'] = 'Used if this search is to search book only';
Code: Select all
define( "NON_INDEXABLE_CONTENT_BOOK", "<!-- pageAttribute: NotSearchableBook -->" );
Code: Select all
$this->CreateParameter('book','null',$this->Lang('param_book'));
$this->SetParameterType('book',CLEAN_STRING);
Code: Select all
$book =& $params['book'];
if( $book ) {
$non_indexable_book = strpos($template->content, NON_INDEXABLE_CONTENT_BOOK);
}
else {
// this is not a book search; ignore non_indexable_content_book templates
$non_indexable_book = false;
}
if ((! $non_indexable) && (! $non_indexable_book))