PDA

View Full Version : Block witf featured spares (Auto)



Vitor Reis
April 20, 2010, 08:39 AM
Hello,

How to configure one block to show Featured Spares? Because in featured sales block just appear ads from "listings" type.

Thank you,
Vitor

Mike
April 28, 2010, 09:05 AM
Hello Vitor,

I've already made necessary changes for your website,
will post instruction here in case somebody need similar

1. Admin Panel>>Blocks
There we can find block Featured Spares block. We need to duplicate this block with small difference.
So i've created new block key - featured_sale_spares.
All settings are the same with featured_sale, difference in smarty code. We need to change variable which store listings of this block. '$featured_sale' changed to '$featured_sale_spares'


{include file='blocks'|cat:$smarty.const.RL_DS|cat:'feature d.tpl' featured=$featured_sale_spares}


now we need to get listings in $featured_sale_spares variable
2. includes/controllers/common.inc.php

Code for Featured Sale (already exists in version)


if ($block_keys['featured_sale'])
{
$featured_sale = $rlListings -> getFeatured( 'sale_rent', 'sale', $config['featured_per_page'], $random['ID'] );
$rlSmarty -> assign_by_ref( 'featured_sale', $featured_sale );
}

Code which we need to add for Featured Spares (same as above, but with small changes)



if ($block_keys['featured_sale_spares'])
{
$featured_sale_spares = $rlListings -> getFeatured( 'spares', 'sale', $config['featured_per_page'], $random['ID'] );
$rlSmarty -> assign_by_ref( 'featured_sale_spares', $featured_sale_spares );
}

This way you could create new blocks like Featured Sale for your specific needs.
Just play with variables of function