Is there another way you would suggest to do a custom redirect? With a custom form is there a way to set the destination page in the submit button or something? Thanks.
eg. I have a custom search template displayed in a small iframe, if no results I don't want user to be redirected. Instead be able to use <IF {NUMRESULTS} is less than 1> and show no result message. Is there a variable which could be added such as redirect=no
I've come up with a method to bypass system redirect or more correctly create a custom search result redirect. It involves copying search.php creating a customsearch.php and altering a couple of lines in combination with a customsearch.tpl. Do you want me to post here or would you rather I didn't?
Custom search redirect; in this example if no search result is returned the user receives a message but the method could be used to execute a script or ajax call etc.
Comments on Manage Redirects
Experienced
Usergroup: Customer
Joined: Jul 29, 2005
Total Topics: 30
Total Comments: 65
Could not find any info on Manage Redirects - admin > misc > manage redirects
Is there a way to add addition redirects?
Is there a way to add custom redirects for new templates?
Thanks.
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
No, what you see is what you get there. I'm not sure I see how redirects could apply to custom templates.
Experienced
Usergroup: Customer
Joined: Jul 29, 2005
Total Topics: 30
Total Comments: 65
Is there another way you would suggest to do a custom redirect? With a custom form is there a way to set the destination page in the submit button or something? Thanks.
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
If I recall, putting <input type="hidden" name="returnto" value="http://yourreturnurl" /> in the form being submitted should do it.
Member
Usergroup: Customer
Joined: May 30, 2007
Total Topics: 12
Total Comments: 45
is there any update on this subject?
eg. I have a custom search template displayed in a small iframe, if no results I don't want user to be redirected. Instead be able to use <IF {NUMRESULTS} is less than 1> and show no result message. Is there a variable which could be added such as redirect=no
Member
Usergroup: Customer
Joined: May 30, 2007
Total Topics: 12
Total Comments: 45
Is there a way to get logic to redirects to work with the search function scripts.webmastersite.net/wsnlinks/wsnmanual410/articles/adding-logic-to-redirects-445.html
I've tried a few variations but no joy..
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
Not possible, since numresults isn't a posted field. The logic only changes redirects anyhow, doesn't remove them.
Member
Usergroup: Customer
Joined: May 30, 2007
Total Topics: 12
Total Comments: 45
I've come up with a method to bypass system redirect or more correctly create a custom search result redirect. It involves copying search.php creating a customsearch.php and altering a couple of lines in combination with a customsearch.tpl. Do you want me to post here or would you rather I didn't?
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
Go ahead.
Member
Usergroup: Customer
Joined: May 30, 2007
Total Topics: 12
Total Comments: 45
Custom search redirect; in this example if no search result is returned the user receives a message but the method could be used to execute a script or ajax call etc.
Custom search form:
<form action="http://www.somesite.com/wsnlinks/customsearch.php?filled=1&whichtype=links&usewrapper=no&custom=yes&TID=customsearch" method="post" >
<input type="text" name="search" >
<input type="submit" value="search" >
</form>
..............................................................................................
Create a customsearch template and save in your tempate directory:
<!-- BEGIN SEARCH links RESULTS -->
<!-- BEGIN REGULAR -->
<IF {NUMRESULTS} is greater than 0>
<p><a href="http://www.somesite.com/wsnlinks/link.php?action=detail&id={LINKID}" >{LINKTITLE}</a><br >
{LINKDESCRIPTION}</p>
<OTHERWISE>
<p>custom message or action</p></IF>
<!-- END REGULAR -->
<!-- END SEARCH links RESULTS -->
...............................................................................................
Copy search.php rename as customsearch.php and save in the same directory, at the top of the file (inside php tag) add this line:
$customaftersearchfail = 'customsearch.php?filled=1&whichtype=links&usewrapper=no&custom=yes&TID=customsearch&search='
then find line no.477 (or thereabouts): $dest = $aftersearchfail; and alter to:
$dest = $customaftersearchfail;
..............................................................................................
Nb.
1. The template above just shows the basic markup needed, you'll probably want to add the custom search form to it etc.
2. Remove all instances of &usewrapper=no if you want to use your existing wrapper.