Tutorial?
Posted: 02 December 2008 05:47 AM   [ Ignore ]
Jr. Member
RankRank
Total Posts:  33
Joined  2007-08-31

Hi, I’m flummoxed - anyone care to offer up a very basic tutorial (bullet points even) on how to get this working at it’s most basic level. What code goes in what template etc.

Best wishes
Lee

Profile
 
 
Posted: 02 December 2008 07:50 AM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  8264
Joined  2006-10-18

Lee, there’s lots of stuff Favorites can do. Each beginning description in the Documentation will tell you what each does.

Is there something specific you’d like to be able to do? Let me know, and I’ll walk you through it smile

 Signature 
Profile
 
 
Posted: 02 December 2008 09:00 AM   [ Ignore ]   [ # 2 ]
Jr. Member
RankRank
Total Posts:  33
Joined  2007-08-31

Pie Man, I want a “Save this entry to my Favorites” link that saves a link back to the weblog and I want to be able to be able to view any saved links somewhere. If I can achieve this I’m sure I can work out the rest. The documentation gives a good explanation of each tag but it doesn’t explain what templates need to be created, what needs to be in them, if a weblog needs setting up to store saved links or how to get started.

Cheers
Lee

Profile
 
 
Posted: 03 December 2008 08:22 AM   [ Ignore ]   [ # 3 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  8264
Joined  2006-10-18

Hi Lee, smile

First, you’ll need to add the “Add this to Favorites” links…

If you have a look at the Favorites:Saved documentation, you’ll see a typical usage here would be placing the code into a single entry page. The example shows it like this (assuming you already have the Weblog:Entries loop in a template where you’re currently showing entries, you’d only need to add the {exp:favorites:saved} stuff {/exp:favorites:saved} code to your page):

{exp:weblog:entries} 
<h2>{title}</h2
<
p>{body}</p
{/exp:weblog:entries} 
  
  
{exp
:favorites:saved} 
  
{if saved} 
<p><a href="{permalink="favorites/favorite_add"}delete/">Remove from my favorites</a></p
{/if} 

{if not_saved} 
<p><a href="{permalink="favorites/favorite_add"}">Add this entry to my favorites</a></p
{/if} 

{
/exp:favorites:saved} 

The conditionals in that code will determine whether to show “Add” or “Remove” links, based on whether the member has saved the entry or not. smile

Once you’ve saved a few entries, you can now create a new template to show the entries you’ve saved.
You can use the example from the Favorites:Entries Documentation:

<ul
{exp:favorites:entries weblog="default_site" orderby="favorites_count" sort="asc" limit="25"
<li><a href="{title_permalink='site/template'}">{title}</a> (Saved on {favorites_date format="%l, %F %j, %Y at %g:%i %a"})</li
{/exp:favorites:entries} 
</ul

That code will show all of the entries you’ve saved to Favorites smile

Perhaps the easiest way to work along with the Docs is to copy and paste the Examples, and fine tune from there wink

let me know if you have any questions or trouble.

 Signature 
Profile
 
 
Posted: 25 June 2009 08:45 PM   [ Ignore ]   [ # 4 ]
Newbie
Rank
Total Posts:  1
Joined  2009-06-13

I just purchased the favorites and I can’t get it to work.  I’ve set up a favorite_add template with the code above and then added the other code to the comments template and the link for add to favorite points to an invalid URI and it doesn’t save the weblog entry.  Any help would be greatly appreciated.

Profile
 
 
Posted: 26 June 2009 07:08 AM   [ Ignore ]   [ # 5 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  8264
Joined  2006-10-18
MB21 - 25 June 2009 08:45 PM

the other code to the comments template and the link for add to favorite points to an invalid URI and it doesn’t save the weblog entry.

MB21,

Those are example paths. You need to change them to match the actual path of your templates. wink

As in, if you’re using this code example:

{if not_saved} 
<p><a href="{permalink='favorites/favorite_add'}">Add this entry to my favorites</a></p
{/if} 

And the path to your “favorite_add” template is ACTUALLY:

site/save_favorite

Then you need to change that path to:

{if not_saved} 
<p><a href="{permalink='site/save_favorite'}">Add this entry to my favorites</a></p
{/if} 
 Signature 
Profile