J-BusinessDirectory - Adding Featured Businesses to the home page

Support Forum

 
 

 

Hi guys,


Simple answer I am sure. How do you add rotating featured businesses to the home page?


I would like to replicate the Featured Business module that is demonstrated at http://demo.cmsjunkie.com/j-businessdirectory/ but am unable to locate the module.


What is the module called as I don't appear to be able to find it?


Thanks in advance

 

 

4 replies

Hi,

 

The business listing slider is included in latest business module. You can activate it by setting slider to yes.

Great thanks George.

It doesn't appear to be possible to configure the size of the image. Ideally I would only want the image to be 170 x 130 pixels.


Also, the links to the business websites are often affiliate links on my website. This hasn't been a problem for business lisings as it just says "Website" on the front end. The problem with the "Latest Businesses" module is that it identifies the website url in the listings. I would like the ability to provide the url link and also the text for the front end.


For example,


The website might be:


www.website.com

 

 

The affiliate url is


https:www.partners.website.comaffiliateid73463294693


The website is funded by affiliate partnerships so the flexibility to show a different text to the url would be useful in my case.

Hi,

 

You can set the image size by overriding the css code.

You can also override the latest business view and modify it according to your needs.
Currently it is not possible to have 2 links for a busienss listing. You can replace the link with a static text.

Hi George,


How would you change the URL link to a text that said "Website" for example. Is this achieved is the CSS code? I have had a look in the CSS code but I am afraid of modifying it and breaking it when making oversides as I am still relatively amateur with Joomla. The CSS code is below, which text would I alter?

 

<?php

/*------------------------------------------------------------------------
# JBusinessDirectory
# author CMSJunkie
# copyright Copyright (C) 2012 cmsjunkie.com. All Rights Reserved.
# @license - http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
# Websites: http://www.cmsjunkie.com
# Technical Support: Forum - http://www.cmsjunkie.com/forum/j-businessdirectory/?p=1
-------------------------------------------------------------------------*/

defined('_JEXEC') or die('Restricted access');

JHtml::_('stylesheet', 'components/com_jbusinessdirectory/assets/css/font-awesome.css');
JHtml::_('stylesheet', 'components/com_jbusinessdirectory/assets/css/slick.css');
JHtml::_('script', 'components/com_jbusinessdirectory/assets/js/slick.js');

$idnt = rand(500, 1500);
?>
<div id="latestbusiness" class="latestbusiness<?php echo $moduleclass_sfx; ?>" >
<?php $index = 0; ?>
<div class="bussiness-slider responsive slider">
<?php if(!empty($items)) ?>
<?php foreach ($items as $company) { ?>
<?php $index ++; ?>
<div>
<div class="slider-item">
<div class="slider-content" style="<?php echo $backgroundCss?> <?php echo $borderCss?>">
<a href="<?php echo JBusinessUtil::getCompanyLink($company, true) ?>">
<?php if(isset($company->logoLocation) && $company->logoLocation!='') { ?>
<img title="<?php echo $company->name?>" alt="<?php echo $company->name?>" src="<?php echo JURI::root().PICTURES_PATH.$company->logoLocation ?>">
<?php } else { ?>
<img title="<?php echo $company->name?>" alt="<?php echo $company->name?>" src="<?php echo JURI::root().PICTURES_PATH.'/no_image.jpg' ?>">
<?php } ?>
</a>
<div class="info" onclick="goToLink('<?php echo JBusinessUtil::getCompanyLink($company, true)?>')">
<div class="hover_info">
<h3><?php echo $company->name ?></h3>

<div class="" itemprop="address" itemscope itemtype="http://data-vocabulary.org/Address">
<i class="dir-icon-map-marker"></i> <?php echo JBusinessUtil::getAddressText($company)?>
</div>

<?php if(!empty($company->phone)) { ?>
<div itemprop="telephone">
<i class="dir-icon-phone"></i> <?php echo $company->phone ?>
</div>
<?php } ?>

<?php if(!empty($company->website)) { ?>
<div>
<a itemprop="website" title="<?php echo $company->name?>" target="_blank" href="<?php echo JRoute::_('index.php?option=com_jbusinessdirectory&view=companies&task=companies.showCompanyWebsite&companyId='.$company->id) ?>"><i class="dir-icon-globe"></i> <?php echo $company->website ?></a>
</div>
<?php } ?>
</div>
</div>
</div>
<div class="slider-item-name">
<?php if(!empty($company->mainCategoryIcon)){ ?>
<a href="<?php echo JBusinessUtil::getCategoryLink($company->mainCategoryId, $company->mainCategoryAlias) ?>">
<i class="pull-right dir-icon-custom rounded-x dir-icon-bg-grey dir-icon-<?php echo $company->mainCategoryIcon ?>"></i>
</a>
<?php } ?>
<h3><?php echo $company->name ?></h3>
<span title="<?php echo $company->averageRating ?>" class="rating-review-<?php echo $idnt ?>"></span>

</div>
</div>
</div>
<?php } ?>
</div>
</div>

<script>
jQuery(document).ready(function() {
jQuery('.bussiness-slider').slick({
dots: false,
infinite: false,
prevArrow: '<a class="controller-prev" href="javascript:;"><span><i class="dir-icon-angle-left"></i></span></a>',
nextArrow: '<a class="controller-next" href="javascript:;"><span><i class="dir-icon-angle-right"></i></span></a>',
customPaging: function(slider, i) {
return '<a class="controller-dot" href="javascript:;"><span><i class="dir-icon-circle"></i></span></a>';
},
<?php if ($params->get('autoplay')) { ?>
autoplay: true,
autoplaySpeed: <?php echo $params->get('autoplaySpeed')?>,
<?php } ?>
speed: 300,
slidesToShow: <?php echo $params->get('nrVisibleItems')?>,
slidesToScroll: <?php echo $params->get('nrItemsToScrool')?>,
infinite: true,
responsive: [
{
breakpoint: 1024,
settings: {
slidesToShow: 3,
slidesToScroll: 3,
infinite: true,
dots: false
}
},
{
breakpoint: 600,
settings: {
slidesToShow: 2,
slidesToScroll: 2
}
},
{
breakpoint: 480,
settings: {
slidesToShow: 1,
slidesToScroll: 1
}
}]
});

jQuery(".slider-content").each(function(){
});

jQuery('.rating-review-<?php echo $idnt ?>').raty({
half: true,
size: 24,
starHalf: 'star-half.png',
starOff: 'star-off.png',
starOn: 'star-on.png',
hintList: ["<?php echo JText::_('LNG_BAD') ?>","<?php echo JText::_('LNG_POOR') ?>","<?php echo JText::_('LNG_REGULAR') ?>","<?php echo JText::_('LNG_GOOD') ?>","<?php echo JText::_('LNG_GORGEOUS') ?>"],
noRatedMsg: "<?php echo JText::_('LNG_NOT_RATED_YET') ?>",
start: function() { return jQuery(this).attr('title')},
path: '<?php echo JURI::root().'components/com_jbusinessdirectory/assets/images/' ?>',
readOnly: true
});
});

function goToLink(link){
document.location.href=link;
}
</script>
 
 
 

5 Item(s)

Show per page