website Favorites
6 posts by 3 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: April 23, 2010 (RSS)
Re: [concrete] website Favorites
By Dave - March 8, 2010
You can have it reload the current page like this:
<a href="#" onclick="<?php wsf_onClickFor($tableOrTag, $recordNum, 'addAndReload'); ?>">Add Favorite</a>
I'm not sure how to have it redirect to another page all together though. I'd have to give that some thought or maybe add something for it to do that.
How will you be using this feature and do you want it to redirect on add and remove? or just one.
Let me know some more details and I'll try to help.
interactivetools.com
Re: [Dave] website Favorites
By concrete - March 8, 2010
Re: [concrete] website Favorites
By Dave - March 10, 2010
interactivetools.com
Re: [concrete] website Favorites
By Dave - March 15, 2010
I tried a few things, but I think the the simplest way to add a redirect on add right now is to modify the websiteFavorites.js file that comes with the plugin and add this line in red:
//
function wsf_add(tableOrTag, recordNum, reload) {
var $ = jQuery; // see: http://docs.jquery.com/Core/jQuery.noConflict
var addClass = _wsf_getClassFor(tableOrTag, recordNum, 'add');
var removeClass = _wsf_getClassFor(tableOrTag, recordNum, 'remove');
$.ajax({
url: '?_wsf_action=add&tableOrTag=' +escape(tableOrTag)+ '&recordNum=' + escape(recordNum),
success: function(errorMessage){
if (errorMessage) { return alert("Error: " + errorMessage); }
if (reload == true) { return window.location.reload(); }
$(addClass).hide();
$(removeClass).show();
window.location = "http://www.google.com/";
return true;
}
});
}
Hope that helps. Let me know if that works for you.
interactivetools.com