How to Prevent Modules Being Loaded in Search Results Page

General questions relating to Joomla! There are other boards for more specific help on Joomla! features and extensions.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
sural98
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 215
Joined: Fri Feb 17, 2006 5:32 pm

How to Prevent Modules Being Loaded in Search Results Page

Post by sural98 » Thu Dec 25, 2008 2:24 pm

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?

sashi
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 102
Joined: Thu Dec 25, 2008 8:05 am

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

Post by sashi » Thu Dec 25, 2008 4:39 pm

could you please elaborate you question? It's somewhat confusing. What do you mean by "all frontpage modules"?

sural98
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 215
Joined: Fri Feb 17, 2006 5:32 pm

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

Post by sural98 » Fri Dec 26, 2008 7:04 am

I mean all modules that are loaded on the frontpage (home page of the web site).

Nikishka
Joomla! Intern
Joomla! Intern
Posts: 81
Joined: Tue Sep 05, 2006 10:25 pm

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

Post by Nikishka » Fri Jan 16, 2009 5:00 am

Is your problem solved?

rajkumarvfx
Joomla! Apprentice
Joomla! Apprentice
Posts: 17
Joined: Thu Nov 13, 2008 9:54 am

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

Post by rajkumarvfx » Fri Jan 16, 2009 6:04 am

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
Cheers!
Raj

Nikishka
Joomla! Intern
Joomla! Intern
Posts: 81
Joined: Tue Sep 05, 2006 10:25 pm

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

Post by Nikishka » Fri Jan 16, 2009 6:20 am

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.

sashi
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 102
Joined: Thu Dec 25, 2008 8:05 am

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

Post by sashi » Fri Jan 16, 2009 8:12 am

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.

ktsixit
Joomla! Intern
Joomla! Intern
Posts: 67
Joined: Fri Mar 13, 2009 12:54 pm

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

Post by ktsixit » Fri Apr 24, 2009 7:50 am

Has anyone found a solution to this?

Nikishka
Joomla! Intern
Joomla! Intern
Posts: 81
Joined: Tue Sep 05, 2006 10:25 pm

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

Post by Nikishka » Fri Apr 24, 2009 3:35 pm

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.

Nikishka
Joomla! Intern
Joomla! Intern
Posts: 81
Joined: Tue Sep 05, 2006 10:25 pm

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

Post by Nikishka » Fri Apr 24, 2009 3:43 pm

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.

ktsixit
Joomla! Intern
Joomla! Intern
Posts: 67
Joined: Fri Mar 13, 2009 12:54 pm

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

Post by ktsixit » Sat Apr 25, 2009 12:29 pm

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

sashi
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 102
Joined: Thu Dec 25, 2008 8:05 am

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

Post by sashi » Sun Apr 26, 2009 3:41 pm

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

User avatar
jwestley
Joomla! Apprentice
Joomla! Apprentice
Posts: 17
Joined: Wed Nov 21, 2007 12:45 am
Location: San Francisco, California, USA
Contact:

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

Post by jwestley » Tue Apr 28, 2009 4:25 pm

Thanks a bunch ktsixit, this saved my butt to finish a project and thought it was the Template I was working with...
James Westley Foreman
Founder http://www.flockworx.com
{ design.develop.engage }

User avatar
jossi
Joomla! Apprentice
Joomla! Apprentice
Posts: 25
Joined: Fri Mar 06, 2009 7:21 pm

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

Post by jossi » Thu May 21, 2009 9:08 pm

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.

User avatar
kane738
Joomla! Apprentice
Joomla! Apprentice
Posts: 28
Joined: Mon Oct 02, 2006 2:48 pm
Location: UK
Contact:

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

Post by kane738 » Wed Jun 03, 2009 3:30 pm

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 :-)

User avatar
rubira
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Tue Jun 09, 2009 6:44 am

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

Post by rubira » Fri Jun 12, 2009 12:51 am

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 :)

bigwaver
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Tue Feb 03, 2009 2:20 pm

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

Post by bigwaver » Wed Jul 01, 2009 8:04 am

Thanks rubira, that works just fine :)

ozaoza
Joomla! Apprentice
Joomla! Apprentice
Posts: 18
Joined: Tue Jun 20, 2006 4:25 pm

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

Post by ozaoza » Thu Oct 22, 2009 2:52 pm

Thank you very much ktsixit. Works perfect!

graywolf336
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Thu Mar 19, 2009 10:52 pm

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

Post by graywolf336 » Wed Nov 11, 2009 5:02 am

Thank you rubira sooooo very much! That just saved me from a lot of work!!!

User avatar
Chacapamac
Joomla! Ace
Joomla! Ace
Posts: 1087
Joined: Wed Feb 20, 2008 6:50 am
Location: Canada, Montreal
Contact:

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

Post by Chacapamac » Wed Nov 18, 2009 5:08 am

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
Can God help us?
Marketing, SEO, Web development - Powered by Joomla!
http://www.grafcomm.ca/

jellis2000
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Fri Mar 26, 2010 1:40 pm

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

Post by jellis2000 » Fri Mar 26, 2010 1:45 pm

Just want to add my thanks to rubira. Worked for me (after clearing cache) so I'm very happy :D

mad_griffith
Joomla! Apprentice
Joomla! Apprentice
Posts: 45
Joined: Sun Dec 04, 2005 11:09 pm

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

Post by mad_griffith » Mon Jun 14, 2010 9:36 am

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. :(

lakmuss
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Fri Aug 01, 2008 9:15 am

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

Post by lakmuss » Fri Jul 16, 2010 12:48 pm

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.

beipink
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Tue Mar 24, 2009 11:22 am

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

Post by beipink » Sat Jul 17, 2010 9:35 am

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

ex19
Joomla! Apprentice
Joomla! Apprentice
Posts: 33
Joined: Fri Apr 23, 2010 7:10 pm

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

Post by ex19 » Thu Jan 06, 2011 7:29 pm

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.

innspiron
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Fri Jan 07, 2011 8:12 pm

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

Post by innspiron » Sun Jan 09, 2011 3:48 pm

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.

ex19
Joomla! Apprentice
Joomla! Apprentice
Posts: 33
Joined: Fri Apr 23, 2010 7:10 pm

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

Post by ex19 » Sun Jan 09, 2011 5:46 pm

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.

innspiron
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Fri Jan 07, 2011 8:12 pm

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

Post by innspiron » Sun Jan 09, 2011 6:05 pm

I see.
I need to load some modules to search page as now it appears only with the search results.

LilSouth
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Mon Apr 13, 2009 9:51 pm

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

Post by LilSouth » Fri Jan 21, 2011 1:37 pm

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...

User avatar
xiangdian
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Thu Sep 10, 2009 12:50 am
Location: Beijing, China
Contact:

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

Post by xiangdian » Mon Aug 15, 2011 12:45 pm

I tried almost all solutions mentioned above, only rubira's works for my site. 1.5.12. Thanks a lot!


Locked

Return to “General Questions - 1.0.x”