Is it possible to change the template for the featured items module? I've looked but it's not obvious to me where/how to do it.
You can modify using simple inline css as well as styling in the VM site stylesheet. Here is a simple example of the standard module with a tweak to put everything inline. I also changed the module so that the image links to the product page and not an image popup
<?php // no direct access
defined('_JEXEC') or die('Restricted access');
$col= 1 ;
?>
<div class="vmgroup<?php echo $params->get( 'moduleclass_sfx' ) ?>">
<?php if ($headerText) { ?>
<div class="vmheader"><?php echo $headerText ?></div>
<?php }
if ($display_style =="div") { ?>
<div class="vmproduct<?php echo $params->get('moduleclass_sfx'); ?>">
<?php foreach ($products as $product) { ?>
<div style="float:left; display:block;margin:10px;text-align:center;">
<?php
if (!empty($product->images[0]) ) {
echo JHTML::_('link', JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id='.$product->virtuemart_product_id.'&virtuemart_category_id='.$product->virtuemart_category_id),$product->images[0]->displayMediaThumb('class="browseProductImage" border="0"',false));
}
?>
<div class="clear"></div>
<?php echo JHTML::link(JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id='.$product->virtuemart_product_id.'&virtuemart_category_id='.$product->virtuemart_category_id), $product->product_name, array('title' => $product->product_name)); ?>
<div class="clear"></div>
<?php
if ($show_price) {
// echo $currency->priceDisplay($product->prices['salesPrice']);
if ($product->prices['salesPrice']>0) echo $currency->createPriceDiv('salesPrice','',$product->prices,true);
// if ($product->prices['salesPriceWithDiscount']>0) echo $currency->priceDisplay($product->prices['salesPriceWithDiscount']);
if ($product->prices['salesPriceWithDiscount']>0) echo $currency->createPriceDiv('salesPriceWithDiscount','',$product->prices,true);
}
?>
<div class="clear"></div>
</div>
<?php
if ($col == $products_per_row && $products_per_row && $col < $totalProd ) {
echo " </div><div style='clear:both;'>";
$col= 1 ;
} else {
$col++;
}
} ?>
</div>
<div class="clear"></div>
<br style='clear:both;' />
<?php
} else {
?>
<ul class="vmproduct<?php echo $params->get('moduleclass_sfx'); ?>">
<?php foreach ($products as $product) : ?>
<li>
<?php
$productModel->addImages($product);
echo $product->images[0]->displayMediaThumb('class="browseProductImage" border="0"');
?>
<?php echo JHTML::link(JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id='.$product->virtuemart_product_id.'&virtuemart_category_id='.$product->virtuemart_category_id), $product->product_name, array('title' => $product->product_name,'rel'=>'facebox')); ?>
<?php
if ($show_price) {
echo $currency->createPriceDiv('salesPrice','',$product->prices,true);
if ($product->prices['salesPriceWithDiscount']>0) echo $currency->createPriceDiv('salesPriceWithDiscount','',$product->prices,true);
}
if ($show_addtocart) echo mod_virtuemart_product::addtocart($product);
?>
</li>
<?php
if ($col == $products_per_row && $products_per_row) {
echo "
</ul>
<ul>";
$col= 1 ;
} else {
$col++;
}
endforeach; ?>
</ul>
<?php }
if ($footerText) : ?>
<div class="vmfooter<?php echo $params->get( 'moduleclass_sfx' ) ?>">
<?php echo $footerText ?>
</div>
<?php endif; ?>
</div>
make sure to do a template override with the module. OR all changes will get overwritten when you update.
What file this goes in?
mod_virtuemart_product/tmpl/default.php
^^^ but you should do an override
Thanks for the help. I really appreciate it.
Hibiscus, as Banquet Tables says I created a new Joomla override is /templates/YOUR_Template/html/mod_virtuemart_product/default.php with that file which saves it from being overwritten after each upgrade