Page 1 of 2

How to Prevent Modules Being Loaded in Search Results Page

Posted: Thu Dec 25, 2008 2:24 pm
by sural98
Joomla 1.0.15
Mambots option in module parameters are set to NO for all modules but all frontpage modules are loading in the search results page.
How can I prevent them from being loaded?

Re: How to Prevent Modules Being Loaded in Search Results Page

Posted: Thu Dec 25, 2008 4:39 pm
by sashi
could you please elaborate you question? It's somewhat confusing. What do you mean by "all frontpage modules"?

Re: How to Prevent Modules Being Loaded in Search Results Page

Posted: Fri Dec 26, 2008 7:04 am
by sural98
I mean all modules that are loaded on the frontpage (home page of the web site).

Re: How to Prevent Modules Being Loaded in Search Results Page

Posted: Fri Jan 16, 2009 5:00 am
by Nikishka
Is your problem solved?

Re: How to Prevent Modules Being Loaded in Search Results Page

Posted: Fri Jan 16, 2009 6:04 am
by rajkumarvfx
Hi sural98

I am not aware joomla has that option. But for search engine's you can give a commant by Robots(google it and see the options and ways). Robots is the file you will mention all the url which your not willing to display in search.

Thanks
Raj

Re: How to Prevent Modules Being Loaded in Search Results Page

Posted: Fri Jan 16, 2009 6:20 am
by Nikishka
I think he means that...well kinda hard to explain...Let's say I have a google search module on my home page. Plus, there are 3-4 modules on left and right columns, like, latest news, or something. When I type my keyword and hit the "Search" button it will open a new page with the search results in between 2 columns with modules. What if I want that search results page be all search results and don't want the modules on left and right columns to show. I mean to disable the modules on search results page.

Re: How to Prevent Modules Being Loaded in Search Results Page

Posted: Fri Jan 16, 2009 8:12 am
by sashi
The first thing you need to know is that modules can be displayed or hide when they are assigned to menu items. (ie if they have ItemId).

In case of search results, the search results are displayed without an item id. That is the reason why your modules are showing up on front page even if they are set to NO.

If you have some coding knowledge you can edit the com_search component and hard code the itemid.

Re: How to Prevent Modules Being Loaded in Search Results Page

Posted: Fri Apr 24, 2009 7:50 am
by ktsixit
Has anyone found a solution to this?

Re: How to Prevent Modules Being Loaded in Search Results Page

Posted: Fri Apr 24, 2009 3:35 pm
by Nikishka
I have several modules and menu on my frontpage, and when I do search none of the modules show up on search page at all. It used to back 5 months ago. Since then I don't have this problem anymore. Maybe I fixed it, I don't know what I did, I forgot! Maybe it was fixed by itself... LOL But I will post it as soon as I remember what I did to solve this problem.

Re: How to Prevent Modules Being Loaded in Search Results Page

Posted: Fri Apr 24, 2009 3:43 pm
by Nikishka
ktsixit wrote:Has anyone found a solution to this?
Choose a module and choose menu assignment and choose te option: Select Menu Item(s) from the List and choose menu pages. That way it will limit the module being shown on search pages. If you choose "All" than it will show up in search results page. So, you have too choose which pages the module should appear and which pages not. In short, try not using the "All" use the "Select Menu Item(s) from the List" instead and test the search results page. Let me know if it worked. By the way, don't forget about clearing the cache and stuff, they might confuse you.

Re: How to Prevent Modules Being Loaded in Search Results Page

Posted: Sat Apr 25, 2009 12:29 pm
by ktsixit
Thank you so much for your replies. I found a similar solution to this issue. This is what I did

1. Go to Menu Manager and create a new Menu.
2. Create a new Menu Module and assign it to the Menu you have created. (Module Parameters>Menu Name). Keep this module NOT enabled.
3. Add a new menu item to your menu. Choose the Search menu Type for it. Save it.
4. After you have created the search menu type item, go to Menu Item's edit page and copy the Link.
5. Paste this Link into the file /httpdocs/modules/mod_search/tmpl/default.php

line 3, replace:
<form action="index.php" method="post">

with this

<form action="menu_item_copied_link" method="post">

It's working ok till now and I am very pleased with that. Thank you again

Re: How to Prevent Modules Being Loaded in Search Results Page

Posted: Sun Apr 26, 2009 3:41 pm
by sashi
Guys,

I've created a movie explaining the process of hiding modules on search page. It's an swf file and following are the links-

http://rapidshare.com/files/225616244/H ... e.swf.html

http://www.filepub.com/public/viewset/26013

http://uploading.com/files/3RD1XL4A/Hiding modules on search page.zip.html

You need to really excuse me 'cos the movie doesn't have an audio. (I don't have a mic. to record).

cheers,
sashi

Re: How to Prevent Modules Being Loaded in Search Results Page

Posted: Tue Apr 28, 2009 4:25 pm
by jwestley
Thanks a bunch ktsixit, this saved my butt to finish a project and thought it was the Template I was working with...

Re: How to Prevent Modules Being Loaded in Search Results Page

Posted: Thu May 21, 2009 9:08 pm
by jossi
I need to do the opposite: I want to display selected modules in the search results page.

I have created a menu item (on a menu that I am not using) of type search, and in module manager I have assigned certain modules to load on that page, but nothing is showing in the results page, besides the hardcoded stuff on my template.

Re: How to Prevent Modules Being Loaded in Search Results Page

Posted: Wed Jun 03, 2009 3:30 pm
by kane738
jwestley wrote:Thanks a bunch ktsixit, this saved my butt to finish a project and thought it was the Template I was working with...
me too! cheers :-)

Re: How to Prevent Modules Being Loaded in Search Results Page

Posted: Fri Jun 12, 2009 12:51 am
by rubira
In Joomla 1.5.11, I opening controller.php found in >>components>com_search and replace line 67 from this:

Code: Select all

// No need to guess Itemid if it's already present in the URL
if (JRequest::getInt('Itemid') > 0) {
    $post['Itemid'] = JRequest::getInt('Itemid');
} else {

    // set Itemid id for links
    $menu = &JSite::getMenu();
    $items = $menu->getItems('link', 'index.php?option=com_search&view=search');

    if(isset($items[0])) {
        $post['Itemid'] = $items[0]->id;
    }

}
...into this:

Code: Select all

$menu = &JSite::getMenu();
$items = $menu->getItems('link', 'index.php?option=com_search&view=search');

if(isset($items[0])) {
    $post['Itemid'] = $items[0]->id;
}

It works for me.. cheers :)

Re: How to Prevent Modules Being Loaded in Search Results Page

Posted: Wed Jul 01, 2009 8:04 am
by bigwaver
Thanks rubira, that works just fine :)

Re: How to Prevent Modules Being Loaded in Search Results Page

Posted: Thu Oct 22, 2009 2:52 pm
by ozaoza
Thank you very much ktsixit. Works perfect!

Re: How to Prevent Modules Being Loaded in Search Results Page

Posted: Wed Nov 11, 2009 5:02 am
by graywolf336
Thank you rubira sooooo very much! That just saved me from a lot of work!!!

Re: How to Prevent Modules Being Loaded in Search Results Page

Posted: Wed Nov 18, 2009 5:08 am
by Chacapamac
Thanks rubira work on 1.5.14
Can we have some kind of control on that... I find that totally crappy that an important core function like search cannot have more control, only with hacking.... Crap!

If I want certain module to appear?????

I see that aticles that appear in a directory when search and click appear outside the directory itself. I will prefer that they appear in context... Any idea....

URL of the article with the Joomla search:
http://www.editionzoneshockey.com/ezh/i ... is&lang=fr

URL of the article in the directory:
http://www.editionzoneshockey.com/ezh/i ... 37&lang=fr

Re: How to Prevent Modules Being Loaded in Search Results Page

Posted: Fri Mar 26, 2010 1:45 pm
by jellis2000
Just want to add my thanks to rubira. Worked for me (after clearing cache) so I'm very happy :D

Re: How to Prevent Modules Being Loaded in Search Results Pa

Posted: Mon Jun 14, 2010 9:36 am
by mad_griffith
rubira wrote:In Joomla 1.5.11, I opening controller.php found in >>components>com_search and replace line 67 from this:

Code: Select all

// No need to guess Itemid if it's already present in the URL
if (JRequest::getInt('Itemid') > 0) {
    $post['Itemid'] = JRequest::getInt('Itemid');
} else {

    // set Itemid id for links
    $menu = &JSite::getMenu();
    $items = $menu->getItems('link', 'index.php?option=com_search&view=search');

    if(isset($items[0])) {
        $post['Itemid'] = $items[0]->id;
    }

}
...into this:

Code: Select all

$menu = &JSite::getMenu();
$items = $menu->getItems('link', 'index.php?option=com_search&view=search');

if(isset($items[0])) {
    $post['Itemid'] = $items[0]->id;
}

It works for me.. cheers :)
Unfortunately, this solution completely trims out those modules appearing in selected categories. :(

Re: How to Prevent Modules Being Loaded in Search Results Pa

Posted: Fri Jul 16, 2010 12:48 pm
by lakmuss
I used the "menu method" for the standard joomla search and it worked fine.

Is there a chance i somehow can eliminate such modules using Custom Properties Search and Pix Search, because the "menu method' is not working with this search modules.

Re: How to Prevent Modules Being Loaded in Search Results Pa

Posted: Sat Jul 17, 2010 9:35 am
by beipink
you don't need to do all that
Edit the third line of this file joomla\modules\mod_search\tmpl\default.php
this
<form action="index.php" method="post">

into this
<form action="index.php?option=com_search" method="post">

regards
kirk
***** Manual signatures are NOT allowed ********** Manual signatures are NOT allowed *****_
the above is true for joomla 1.5.x

Re: How to Prevent Modules Being Loaded in Search Results Pa

Posted: Thu Jan 06, 2011 7:29 pm
by ex19
I have this issue in 1.5.2
I've tried beipink's solutiion and the one posted above and the code on the higher up post here is not the same as mine. Still looking for a solution.

Re: How to Prevent Modules Being Loaded in Search Results Pa

Posted: Sun Jan 09, 2011 3:48 pm
by innspiron
ex19 wrote:I have this issue in 1.5.2
I've tried beipink's solutiion and the one posted above and the code on the higher up post here is not the same as mine. Still looking for a solution.

I have the same problem. Can not find the solution and it stopped my project :(
sural98, did you find the way to deal with that? Please help.

Re: How to Prevent Modules Being Loaded in Search Results Pa

Posted: Sun Jan 09, 2011 5:46 pm
by ex19
in my case I had the newsflash being called onto the home page in the top position. It was enabled only for Home, but was showing in search. I removed newsflash and disabled it, just organized the front page differently.

Re: How to Prevent Modules Being Loaded in Search Results Pa

Posted: Sun Jan 09, 2011 6:05 pm
by innspiron
I see.
I need to load some modules to search page as now it appears only with the search results.

Re: How to Prevent Modules Being Loaded in Search Results Pa

Posted: Fri Jan 21, 2011 1:37 pm
by LilSouth
Go to the file:
joomla\modules\mod_search\tmpl\default.php

Change:

Code: Select all

<form action="index.php" method="post">
to:

Code: Select all

<form action="index.php?option=com_search&view=search" method="post">
It works for me...

Re: How to Prevent Modules Being Loaded in Search Results Pa

Posted: Mon Aug 15, 2011 12:45 pm
by xiangdian
I tried almost all solutions mentioned above, only rubira's works for my site. 1.5.12. Thanks a lot!