News:

Looking for documentation? Take a look on our wiki

Main Menu

Load module in Search results

Started by kratzi, February 25, 2013, 15:13:22 PM

Previous topic - Next topic

kratzi

Hi,

I am using quite often the module position from banquet-pro. http://www.kaizenmediaworks.com/virtuemart-template-and-module-control

I would like to load a module into the search results. What view is it I have to choose .

<?php if (JRequest::getVar('view')=='search') { ?>
<div id="searchmod"><jdoc:include type="modules" name="search" /></div>
<?php } ?>

This one does not work.

Thank you

kratzi

PRO

what do you want to load inside the module?
http://www.kaizenmediaworks.com/mod-pro-search-header

<?php
$searchurl=JRequest::getVar('keyword',0);
if (!empty($searchurl)){?>
<div id="searchmod"><jdoc:include type="modules" name="search" /></div>
<?php } ?>

kratzi

Great thank you.

I am loading a slider in the top of the page. Your code works perfectly.

kratzi

kratzi

Maybe one more

<?php if (JRequest::getVar('view')!='category' &&
          in_array(JRequest::getVar('view'), array(article,productdetails,user,profile,virtuemart,cart))) { ?>
<jdoc:include type="modules" name="slider" /></div>
<?php } ?>

If not loading the following views (category,article,productdetails,user,profile,virtuemart,cart) then I would like to load another module (slider)

Would be great if you could look at the code as its not working as I want it to :)

PRO


kratzi

Hi,

I am loading different slider in the following positions: category,article,productdetails,user,profile,virtuemart,cart

Now I want another slider to be loaded always when no view which already has a slider applies.

This new slider should be loaded always when no other slider from the above mentioned is loaded.

Hope you get the sense.

Regards


PRO

do something like this
use ==   or !=


<?php
$viewis=JRequest::getVar('view');
if (( $viewis=='productdetails') OR ( $viewis=='productdetails') OR ( $viewis=='productdetails') OR ( $viewis=='productdetails')  ) {


} ?>

kratzi

Hi and thank you for your help.

I am nearly done with all the positions.

Could you please also help me with this one:

<?php if (JRequest::getVar('view')=='manufacturer') { ?>
<jdoc:include type="modules" name="slider<?php echo
JRequest::getInt('virtuemart_manufacturer_id',0); ?>" />
<?php } ?>

Somhow the slider is not loading in manufacturer view. In category view this code works perfectly.

<?php if (JRequest::getVar('view')=='category') { ?>
<jdoc:include type="modules" name="slider<?php echo
JRequest::getInt('virtuemart_category_id',0); ?>" />
<?php } ?>

kratzi

PRO

kratzi

see what happens when you do this

<?php if (JRequest::getVar('view')=='manufacturer') { ?>
<h1>test</h1>
<?php } ?>

kratzi

Hi,

nothing happens unfortunately.

Somehow the manufacturer view does not load.

Regards

PRO

are you sure you are not looking at the manufacturer products?

because that view is   category & manufacturer id


kratzi

#11
Hi,

thank you. In fact I was looking for manufacturer products?

Thank you for your solution.


Thank you

kratzi