@All Couchies!
Greetings!
I have a featured listing (clonable template). It has two editables:
Only the posts that are marked as featured appear in the list. But due to the 'featured_date' it does not get displayed after a maximum duration is surpassed.
The Code is:
Now what happens is that when all 'featured_duration' are exhausted, the listing does not appear. Nevertheless, the code in <cms:no_results>...</cms:no_results> does not show up.
Is there a better way to do the above so that when there are no featured items, the <cms:no_results> block gets executed?
What I was thinking, that if the 'featured' editable value can be changed from Yes to No when the 'featured_duration' is over, and the 'featured_duration' date be reset, then the <cms:no_results> block will get executed.
Regards,
GenXCoders
Greetings!
I have a featured listing (clonable template). It has two editables:
- Code: Select all
<cms:editable name='featured' label='Do you want to feature this business?' type='radio' opt_values='No | Yes' opt_selected='No' order='1' />
<cms:editable name='featured_duration' label='Set duration for featuring this Business' desc='set only if Feature Business is set to YES' type='datetime' order='2' />
Only the posts that are marked as featured appear in the list. But due to the 'featured_date' it does not get displayed after a maximum duration is surpassed.
The Code is:
- Code: Select all
<div id="feature-item_listing_block">
<div class="container">
<div class="row">
<div class="col-sm-12">
<div class="col-md-12 feature-item-listing-heading bt_heading_3 text-center">
<h1>Featured <span>Listing</span></h1>
<div class="blind line_1"></div>
<div class="flipInX-1 blind icon">
<span class="icon"><i class="fa fa-stop"></i> <i class="fa fa-stop"></i></span>
</div>
<div class="blind line_2"></div>
</div>
<div class="row">
<cms:pages masterpage='business-listing.php' folder=k_folder_name order='asc' limit='8'>
<cms:no_results>
<div class="col-md-8 col-md-offset-2">
<div style="margin: 100px auto 130px; text-align: center;">
<div class="alert alert-warning">
<strong>Oops!</strong>
<br>
No businesses listed under this category.
</div>
</div>
</div>
</cms:no_results>
<cms:set exp_date="<cms:date featured_duration format='Y-m-d' />" scope='global' />
<cms:set cur_date="<cms:date format='Y-m-d' />" scope='global' />
<cms:if featured=='Yes' && cur_date le exp_date>
<div class="col-md-3 col-sm-6 col-xs-12">
<div class="gxcpl-list-container">
<div class="gxcpl-list-image-container">
<img src="<cms:if bl_business_banner><cms:show bl_business_banner /><cms:else /><cms:show k_site_link />assets/images/list-no-image-pusad-app-color.jpg</cms:if>" class='gxcpl-list-banner' />
<img class="gxcpl-list-logo" src="<cms:if bl_business_image><cms:show bl_business_image /><cms:else /><cms:show k_site_link />assets/images/list-no-logo-color.png</cms:if>">
</div>
<div class="gxcpl-list-text-container">
<strong><cms:show k_page_title /></strong>
<div class="gxcpl-ptop-5"></div>
<small class="gxcpl-list-folder-title"><cms:excerptHTML count='3'><strong><cms:show k_page_foldertitle /></strong></cms:excerptHTML> <cms:show_votes 'my_vote'><cms:show count_up /> <i class='fa fa-thumbs-o-up'></i> <cms:show count_down /> <i class='fa fa-thumbs-o-down'></i></cms:show_votes></small>
<div class="gxcpl-ptop-5"></div>
<small class="text-justify" style="overflow: hidden;">
<cms:excerptHTML count='20'><cms:show bl_about_desc /></cms:excerptHTML>
</small>
</div>
<div class="gxcpl-list-location">
<small><i class="fa fa-map-marker"></i> <cms:show_repeatable 'bl_business_addr' limit='1'><cms:if bl_business_pincode><cms:show bl_business_pincode /><cms:else />Unavailable</cms:if></cms:show_repeatable></small>
</div>
<a href="<cms:show k_page_link />">
<div class="gxcpl-list-button">
<i class='fa fa-eye'></i> View Details
</div>
</a>
</div>
</div>
</cms:if>
</cms:pages>
</div>
</div>
<div class="col-md-12">
<div class="gxcpl-ptop-30"></div>
<div class="gxcpl-ptop-30"></div>
</div>
</div>
</div>
Now what happens is that when all 'featured_duration' are exhausted, the listing does not appear. Nevertheless, the code in <cms:no_results>...</cms:no_results> does not show up.
Is there a better way to do the above so that when there are no featured items, the <cms:no_results> block gets executed?
What I was thinking, that if the 'featured' editable value can be changed from Yes to No when the 'featured_duration' is over, and the 'featured_duration' date be reset, then the <cms:no_results> block will get executed.
Regards,
GenXCoders