J-BusinessDirectory - How to add logical expression for useful function on listing results

Support Forum

 
 

 

The section of code (from listings_list_style_6.php) prints the hyperlinked word 'website' for each search result listing. I would like to alter it, so that the first if statement only becomes true (i.e. only parse the remainder of the code) if the package the business has doesn't equal what I have named the 'Admin only' package.

Please if anyone can assist me. I have written the reasons for the desired update below.

<div class="item-info-wrap">
<?php if ($showData && !empty($company->website) && (isset($company->packageFeatures) && in_array(WEBSITE_ADDRESS, $company->packageFeatures) || !$enablePackages)) {
if ($appSettings->enable_link_following) {
$followLink = (isset($company->packageFeatures) && in_array(LINK_FOLLOW, $company->packageFeatures) && $enablePackages) ? 'rel="follow noopener"' : 'rel="nofollow noopener"';
} else {
$followLink = 'rel="noopener"';
} ?>
<div class="item-info truncate-text">
<i class="la la-home"></i><a target="_blank" <?php echo $followLink ?> href="<?php echo $this->escape($company->website) ?>"><?php echo JText::_("LNG_WEBSITE") ?></a>
</div>
<?php } ?>


I feel it is a benefit for a business to have their website linked directly from the search listing results themselves - and so imo, it makes sense to only show such a hyperlink if a business has one of the 3 public packages I am using. The forth package in my setup is for admin use only - which I am reserving for entries in the directory which don't have a paid listing. I still want such free listed companies to have their website linked on the corresponding listing detail page - but not on the serach results listings themselves.

1 replies

A slight varient, and maybe preferable for me, would be for the 'Admin only' package listings to still display a 'website' link, but redirect to the business listing page where the url is shown (rather than linking dorect to website). This would look aesthetically better (unity of search listing results), but still offer paid listings the advantage of a direct website link from the search results.

 
 
 

2 Item(s)

Show per page