I have a tabbed box - viewable here publicmediaexchange, bottom left - that I am using to display the most popular entries on our site.
All entries are published to a channel named “treatment”. Some entries are viewable by everyone, and some only to member stations (determined by if member_group conditional and custom status).
Audio and Video are determined by a custom field in the “treatment” channel publish page.
I am using an if conditional to show only video or only audio.
Everything seems to be working, but I cannot get the Limit=“2” to work.
Here is my code:
<div class="boxtop">
<h1>MOST POPULAR</h1>
</div> <!-- /boxtop -->
<div class="spacer1"></div>
<div class="tabbed-box">
<ul class="tabs">
<li><a href="#">VIDEO</a></li>
<li><a href="#">AUDIO</a></li>
</ul>
<!-- Begin 1st tab content --><div class="tabbed-content">
<div class="spacer10"></div>
<div class="popular">
<!-- Begin station view of all entries, no filtering -->
{if member_group == "8" OR member_group == "9" OR member_group == "1"}
{exp:channel:entries channel="treatment" orderby="view_count_one" sort="desc" disable="pagination|member_data|trackbacks" limit="2" dynamic="off"}
{if media_type == "Video"}
<div class="pop_box">
{exp:imgsizer:size src="{treatment_img}" width="204"}
<h2><a href="http://www.publicmediaexchange.org/index.php/treatment/{url_title}">{title}</a></h2>
<h3>{identifierSource}</h3>
<h4>Entry Date: {if treatment_date == ""}{entry_date format="%F %d, %Y"}{if:else}{treatment_date format="%F %d, %Y"}{/if}
Media Type: {titleType}
Total Time: {formatDuration}</h4>
<p>{exp:word_limit total="20"}{description}{/exp:word_limit}</p>
<p><a href="http://www.publicmediaexchange.org/index.php/treatment/{url_title}" class="more">Clip and Full Record</a></p>
<p><div class="spacer2"></div></p>
<p></div> <!-- /pop_box --></p>
<p><hr ></p>
<p>{/if}</p>
<p>{/exp:channel:entries}</p>
<p>{if:else}<!-- END STATION VIEW OF ALL ENTRIES, NO FILTERING | BEGIN PUBLIC VIEW --></p>
<p>{exp:channel:entries channel="treatment" orderby="view_count_one" sort="desc" status="Public" disable="pagination|member_data|trackbacks" limit="2" dynamic="off"}</p>
<p>{if media_type == "Video"}</p>
<p><div class="pop_box"></p>
<p>{exp:imgsizer:size src="{treatment_img}" width="204"}</p>
<h2><a href="http://www.publicmediaexchange.org/index.php/treatment/{url_title}">{title}</a></h2>
<h3>{identifierSource}</h3>
<h4>Entry Date: {if treatment_date == ""}{entry_date format="%F %d, %Y"}{if:else}{treatment_date format="%F %d, %Y"}{/if}
Total Time: {formatDuration}</h4>
<p>{exp:word_limit total="20"}{description}{/exp:word_limit}</p>
<p><a href="http://www.publicmediaexchange.org/index.php/treatment/{url_title}" class="more">Clip and Full Record</a></p>
<p><div class="spacer2"></div></p>
<p></div> <!-- /pop_box --></p>
<p><hr ></p>
<p>{/if}</p>
<p>{/exp:channel:entries}</p>
<p>{/if}<br />
<!-- END PUBLIC VIEW WITH FILTERING --></p>
<p><a href="http://www.publicmediaexchange.org/index.php/treatment/{url_title}" class="more">More Video</a></p>
<p><div class="spacer1"></div></p>
<p></div> <!-- /popular --> </p>
<p></div> <!-- /End 1st tab content --></p>
<p> </p>
<p><br />
<!-- Begin 2nd tab content --><div class="tabbed-content"></p>
<p><div class="spacer10"></div></p>
<p><div class="popular"></p>
<p><!-- Begin station view of all entries, no filtering --><br />
{if member_group == "8" OR member_group == "9" OR member_group == "1"}</p>
<p>{exp:channel:entries channel="treatment" orderby="view_count_one" sort="desc" disable="pagination|member_data|trackbacks" limit="2" dynamic="off"}</p>
<p>{if media_type == "Audio"}</p>
<p><div class="pop_box"></p>
<p>{exp:imgsizer:size src="{treatment_img}" width="204"}</p>
<h2><a href="http://www.publicmediaexchange.org/index.php/treatment/{url_title}">{title}</a></h2>
<h3>{identifierSource}</h3>
<h4>Entry Date: {if treatment_date == ""}{entry_date format="%F %d, %Y"}{if:else}{treatment_date format="%F %d, %Y"}{/if}
Media Type: {titleType}
Total Time: {formatDuration}</h4>
<p>{exp:word_limit total="20"}{description}{/exp:word_limit}</p>
<p><a href="http://www.publicmediaexchange.org/index.php/treatment/{url_title}" class="more">Clip and Full Record</a></p>
<p><div class="spacer2"></div></p>
<p></div> <!-- /pop_box --></p>
<p><hr ></p>
<p>{/if}</p>
<p>{/exp:channel:entries}</p>
<p>{if:else}<!-- END STATION VIEW OF ALL ENTRIES, NO FILTERING | BEGIN PUBLIC VIEW --></p>
<p>{exp:channel:entries channel="treatment" orderby="view_count_one" status="Public" sort="desc" disable="pagination|member_data|trackbacks" limit="2" dynamic="off"}</p>
<p>{if media_type == "Audio"}</p>
<p><div class="pop_box"></p>
<p>{exp:imgsizer:size src="{treatment_img}" width="204"}</p>
<h2><a href="http://www.publicmediaexchange.org/index.php/treatment/{url_title}">{title}</a></h2>
<h3>{identifierSource}</h3>
<h4>Entry Date: {if treatment_date == ""}{entry_date format="%F %d, %Y"}{if:else}{treatment_date format="%F %d, %Y"}{/if}
Total Time: {formatDuration}</h4>
<p>{exp:word_limit total="20"}{description}{/exp:word_limit}</p>
<p><a href="http://www.publicmediaexchange.org/index.php/treatment/{url_title}" class="more">Clip and Full Record</a></p>
<p><div class="spacer2"></div></p>
<p></div> <!-- /pop_box --></p>
<p><hr ></p>
<p>{/if}</p>
<p>{/exp:channel:entries}</p>
<p>{/if}<br />
<!-- END PUBLIC VIEW WITH FILTERING --></p>
<p><a href="http://www.publicmediaexchange.org/index.php/treatment/{url_title}" class="more">More Audio</a></p>
<p><div class="spacer1"></div></p>
<p></div> <!-- /popular --></p>
<p></div> <!-- /End 2nd tab content --><br />
<br />
</div> <!-- /End Tabbed Box -->Thanks, in advance 😊