VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: kratzi on February 25, 2013, 15:13:22 PM

Title: Load module in Search results
Post by: kratzi on February 25, 2013, 15:13:22 PM
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
Title: Re: Load module in Search results
Post by: PRO on February 25, 2013, 17:29:44 PM
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 } ?>
Title: Re: Load module in Search results
Post by: kratzi on February 25, 2013, 17:45:59 PM
Great thank you.

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

kratzi
Title: Re: Load module in Search results
Post by: kratzi on February 25, 2013, 22:19:13 PM
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 :)
Title: Re: Load module in Search results
Post by: PRO on February 25, 2013, 22:42:15 PM
what do you want?

when & where?
Title: Re: Load module in Search results
Post by: kratzi on February 26, 2013, 00:55:12 AM
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

Title: Re: Load module in Search results
Post by: PRO on February 26, 2013, 14:30:43 PM
do something like this
use ==   or !=


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


} ?>
Title: Re: Load module in Search results
Post by: kratzi on March 02, 2013, 11:30:52 AM
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
Title: Re: Load module in Search results
Post by: PRO on March 02, 2013, 17:26:41 PM
kratzi

see what happens when you do this

<?php if (JRequest::getVar('view')=='manufacturer') { ?>
<h1>test</h1>
<?php } ?>
Title: Re: Load module in Search results
Post by: kratzi on March 02, 2013, 17:38:38 PM
Hi,

nothing happens unfortunately.

Somehow the manufacturer view does not load.

Regards
Title: Re: Load module in Search results
Post by: PRO on March 02, 2013, 19:21:52 PM
are you sure you are not looking at the manufacturer products?

because that view is   category & manufacturer id

Title: Re: Load module in Search results
Post by: kratzi on March 05, 2013, 20:50:49 PM
Hi,

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

Thank you for your solution.


Thank you

kratzi