Main
Index
Search
Posts
Who's
Online
Log
In

Home: Products: CMS Builder: Plugins & Add-ons:
website Favorites

 

 


concrete
User

Mar 7, 2010, 7:48 PM

Post #1 of 6 (3909 views)
Shortcut
website Favorites Can't Post

How can forward the user to a page after the favorite has been added.


Dave
Staff / Moderator


Mar 8, 2010, 3:44 PM

Post #2 of 6 (3889 views)
Shortcut
Re: [concrete] website Favorites [In reply to] Can't Post

Hi concrete,

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.

Dave Edis - Senior Developer
interactivetools.com
 


concrete
User

Mar 8, 2010, 4:16 PM

Post #3 of 6 (3885 views)
Shortcut
Re: [Dave] website Favorites [In reply to] Can't Post

I just need to redirect it when it is added.


Dave
Staff / Moderator


Mar 10, 2010, 10:34 AM

Post #4 of 6 (3867 views)
Shortcut
Re: [concrete] website Favorites [In reply to] Can't Post

Ok, this isn't possible right now. But I'm going to look into it further and see if I can come up with a simple way to do it. Stay tuned.

Dave Edis - Senior Developer
interactivetools.com
 


Dave
Staff / Moderator


Mar 15, 2010, 10:10 AM

Post #5 of 6 (3552 views)
Shortcut
Re: [concrete] website Favorites [In reply to] Can't Post

Hi concrete,

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:


Code
// 
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.

Dave Edis - Senior Developer
interactivetools.com
 


orangewine6
New User

Apr 23, 2010, 5:02 AM

Post #6 of 6 (2586 views)
Shortcut
Re: [Dave] website Favorites [In reply to] Can't Post

 
Hi

Thanks for that!




Thanks and regards