Mitchell:
I’m trying to accomplish this same thing, but I’m not very adept at this sort of thing, so I’m hoping you can help me. Here’s what I’ve done so far:
1. I’ve added the jquery script line to the head of my template:
<script src="http://www.missionequip.com/jquery.js"></script>
2. I’ve added this script to the head of my template:
<script>
$("a.save").click( function(event) {
$("div#somedivid").load( "http://www.missionequip.com/blog/index.php/site/savefavorites/" + "/" + $(this).attr("alt") );
});
</script>
3. This is what the code for the “Add to favorites” link looks like (this code is surrounded by weblog entries tags which I’ve left out):
<p><a href="{simplelink}">{title}</a><br />
{if logged_in}{exp:favorites:saved entry_id="{entry_id}"}{if saved}<ul class="simplelinks"><li class="addtofavorites">Added To My Featured Links</li></ul>{/if}{if not_saved}<ul class="simplelinks"><li class="addtofavorites"><a class="save" href="{path='site/savefavorites'}{entry_id}" title="Add To My Featured Links" alt="{entry_id}"><div id="somedivid">Add To My Featured Links</div></a></li></ul>{/if}{/exp:favorites:saved}{/if}{if logged_out}<ul class="simplelinks"><li class="addtofavorites">Sign In or Register to Add to Your Featured Links</li></ul>{/if}</p>
4. The site/savefavorites template has the exp:favorites:save function.
With it implemented in this way, clicking on the “Add To My Featured Links” link sends people directly to the site/savefavorites templates - it doesn’t load the “success” message into the somedivid div.
Any thoughts? You can see the “system” in action on this page, but you have to be logged in first. Let me know if you want to see the front end, and I’ll PM you a username and password.
Thanks in advance for any help you can offer - I really appreciate it.
Frank