Question about the Favorites Shared Tag
Posted: 15 March 2008 12:21 PM   [ Ignore ]
Sr. Member
RankRankRankRank
Total Posts:  153
Joined  2007-02-19

I’ll be purchasing Favorites before to long here and I love that you can show related entries with the Shared Tag. I’m wondering though, when the site launches, there will be nothing saves as a favorite yet by members. Is it possible to use some sort of conditional statement that will basically tell the shared items to only show when there is actually items to show?

For example, I’ll have a heading that says “those that saved this item, also like:” so if there are no saved entries, I’d rather not have the heading without some entries following it. I guess I’ll just need to figure out a way to only show the heading “those that saved...” when there are actually entries to show. Hope that makes sense what I’m asking. smile

Profile
 
 
Posted: 15 March 2008 02:07 PM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  701
Joined  2004-03-30

Deron,

In our more recent software modules we have better handling for this. But for now what you can do is something I picked up from Hop Studios, www.hopstudios.com. Run a conditional on the count variable. If count is equal to one, show the header html of the block containing the list. Same for the footer. This way, if there are entries, you show the header and footer code of your block along with the list of entries. If not, nothing shows.

mk

 Signature 

Mitchell Kimbrough

Profile
 
 
Posted: 16 March 2008 10:57 AM   [ Ignore ]   [ # 2 ]
Sr. Member
RankRankRankRank
Total Posts:  153
Joined  2007-02-19

Hey Mitchell, thanks for getting back to me.

Me not being a programmer and doing a lot with conditionals, sometimes they really trip me up. Are you referring to something similar to what I have below? Should that do the trick?

{exp:favorites:shared limit="5"}
{if count 
== 1}
<h3>People that liked this entryalso liked:</h3>
<
ul class="related">
{/if}
<li><a href="{title_permalink=template_group/template}" title="{title}">{title}</a></li>
{if count == total_results}
</ul>
{/if}
{
/exp:favorites:shared}

Profile
 
 
Posted: 16 March 2008 08:31 PM   [ Ignore ]   [ # 3 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  701
Joined  2004-03-30

Yeah. I haven’t done it lately, but that’s about it.

mk

 Signature 

Mitchell Kimbrough

Profile