Using favorites as a digg like system
Posted: 15 June 2008 04:39 PM   [ Ignore ]
Newbie
Rank
Total Posts:  3
Joined  2006-02-18

So it seems that favorites should be able to work like Digg.

I want to have a display of all my regular web log entires.
To the left I want a little vote button and above that, a total number of votes.

Since I can’t find any examples of Favorites in action, I can’t tell if this is possible.  And it is not clear to me from the documentation.

I will need to use some kind of AJAX (jquery?) so that the votes update in real time without a page reload so any example of that would be helpful as well.

Can favorites emulate digg?  Does someone have an example page to look at and perhaps even code samples of this?  I’ve looked at several of the posts in this forum mentioning ajax, but it also appears that all the sample links are dead

Thanks

Profile
 
 
Posted: 16 June 2008 08:16 AM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3374
Joined  2006-10-18
artlab - 15 June 2008 04:39 PM

I want to have a display of all my regular web log entires. To the left I want a little vote button…

Have a look here: Favorites 2.1 Saved Documentation

{exp:favorites:saved entry_id="{entry_id}"}

{if saved}
<p>You have already saved this link.</p>
{/if}

{if not_saved}
<p>Do you want to save this link?</p>
{/if}

{
/exp:favorites:saved}

You would place this within the Weblog:Entries loop. You could definitely use Ajax on this as well - have a poke around on the forums. smile

artlab - 15 June 2008 04:39 PM

...and above that, a total number of votes.

Certainly: Favorites 2.1 Entry Count Documentation

{exp:favorites:entry_count entry_id="{entry_id}"}

{favorites_count}
{if favorites_count
== 0}No one liked this entry!{/if}

{
/exp:favorites:entry_count}

Once again, stuff that into the Weblog:Entries loop smile

Both of these however, should probably populate dynamically if you’re viewing a Single Entry Page (as in, you do not need to stuff them into the Weblog:Entries loop) smile

 Signature 
Profile
 
 
Posted: 17 June 2008 01:21 PM   [ Ignore ]   [ # 2 ]
Newbie
Rank
Total Posts:  3
Joined  2006-02-18

Definitely helps my understanding of how favorites works.

But not at all clear on how to implement the Ajax functionality.
I’ve looked at several posts, but I haven’t found any live examples that match the offered code (e.g. thedailysheep) so I’m not even clear what things are supposed to do!

Matrtixwatch seems to have it working, but no code posted anywhere.

This has got to be something so basic and often requested that a sample on the solspace site would be great.
Any chance of that?

Profile
 
 
Posted: 18 June 2008 06:25 AM   [ Ignore ]   [ # 3 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3374
Joined  2006-10-18

artlab,

Do a search here for Favorites Ajax - you’ll find several posts smile

Here’s one of them: http://www.solspace.com/forums/viewthread/83/

 Signature 
Profile
 
 
Posted: 18 June 2008 10:16 AM   [ Ignore ]   [ # 4 ]
Newbie
Rank
Total Posts:  3
Joined  2006-02-18

I have done that search which is why I asked.  The sample links in these examples are dead.  So it is really difficult to determine what the code is even supposed to achieve.
The only thing I can find is MatrixWatch and of course no code
But I think I am convinced this is do-able and will buy module and try.
If I get it working, I can post a sample with complete code for all components. Maybe solspace can host a working sample so we don’t end up with dead example links?

Profile
 
 
Posted: 19 June 2008 06:26 AM   [ Ignore ]   [ # 5 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3374
Joined  2006-10-18

If all is “documented” correctly, you shouldn’t need to have a hosted example anywhere smile
Just a breakdown of what, how and where to place the code. wink

 Signature 
Profile