Total number of saved favourites
Posted: 31 March 2008 05:06 AM   [ Ignore ]
Newbie
Rank
Total Posts:  2
Joined  2006-08-17

Hi All,

Really enjoying the favorites module. I’d like to be able to show the total number of favorites saved by the current user: ie: ‘You currently have X favorites.’. I’ve tried using {total_results} inside the {exp:favorites:entries} tag but this repeats for each entry. I think I need something like {exp:stats}{total_entries}{/exp:stats} to show only favorites. Can anyone help?

Thanks,

- J

Profile
 
 
Posted: 31 March 2008 08:02 AM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  2691
Joined  2006-10-18

Jamiee,

Much like the weblog:entries loop, there’s no real nice way of doing this, but this will work, with PHP enabled for the template:

{exp:favorites:entries}<?php $totalresults = {total_results};?>{/exp:favorites:entries}

You currently have <?php
echo $totalresults ?> Favorites

{exp
:favorites:entries}

<p><a href="{title_permalink='comments'}">{title}</a></p>

{/exp:favorites:entries}

 Signature 
Profile
 
 
Posted: 31 March 2008 01:53 PM   [ Ignore ]   [ # 2 ]
Newbie
Rank
Total Posts:  2
Joined  2006-08-17

many thanks - I appreciate the help.

- J

Profile