Posted by zzJames on January 8, 2007 at 1:53pm
Hi
I realise this is a support question, but it raised no joy for me in the usual drupal forum, so I ask here because maybe there are more experienced people using Wolfgang's modules (or Wolfgang himself!)
ok question is.....
in the pagerouteUI admin pages there is an option "Preserve destination parameter during this route."
I assume this means the URL to be directed to at the end of the route?
How do I pass/specify this parameter, there seems to be nothing in the pageroute documentation.....
Thankyou
zz_james
Comments
last node
since the I wanted the destination to be a view of the usernode, I just made it the last step in the route, and took the 'back' button away.
didn't work
any ideas pageroute guru's..
destination parameter
The destination parameter needs to be used in the url for the pageroute. So if you installed per the handbook, your url would be nodeprofile?destination=userprofile. Or whatever you want in place of userprofile. Again, if you installed per the handbook you will have a link in navigation called nodeprofile. Unfortunately the path in this menu item is locked and you can't change it, so you will have to create a new menu item with the fully qualified url: http://www.google.com/nodeprofile?destination=userprofile.
For some reason I couldn't get it to work without the fully qualified path.
absolute URL
because without the full URL including protocol drupal urlencodes the string. ugh. why does it have to be so painful?!
i also tried writerprofile/destination/userprofile hoping that clean urls might take care of it, but no such luck :)
hopefully i'll remember to change this path when i got from my dev site to my live site...
i definitely agree that it would be nice if pageroute had a generic "view any page" page type
destination
of course, this is also a possible solution.
otherwise the parameter would be destination, e.g. use pageroute_path?destination=usernode.
with the option you mentioned checked, the user will be routed to the path /usernode on "exit"
things don't quite fit???
as always seems to be the drupal case.. lots of cool things.. but they just don't quite fit together
so i am trying both zz's and fago's ideas here.. and here are the issues with both:
i am trying to put together a registration flow
so my best attempt so far uses:
so basically i have:
AND then when i am done i want to do what zz wants.. and go to some view
BUT.. the issues:
fago's:
zzJames:
also i need 2 different page routes to go to depending on which role i am signing up for.. and logintoboggon will be broken here since it has only one redirect setting
so i either have to hack logintoboggon to handle this or hack pageroute
Peter Lindstrom
LiquidCMS
Peter Lindstrom
LiquidCMS - Content Solution Experts
step closer
ok, i guess the almost answer above was that the logintobogon would set the redirect to:
mypageroute?destination=usernode
and that does work
but as mentioned i have the issue of having multiple redirects.. which i guess is a hack, hook or feature addition to logintoboggon module.. let you know what i come up with
Peter Lindstrom
LiquidCMS
Peter Lindstrom
LiquidCMS - Content Solution Experts
A couple hacks
As I too have butted up against this limitation I've found a couple different approaches to this.
1) If the last page in your pageroute is one on which you are editing or creating a node, you can make the template for that node contain a button or anchor tag that contains the link to your intended destination. In my case, the last node in my registration pageroute is a page where the user is filling out a custom questionaire content type, and not something they'll ever edit again. So the template for this node view can contain whatever I want and I don't have to worry about anyone ever seeing this again. You may be able to create a custom type with no fields, assign it to the last page in your pageroute, and just have the template for this node contain a button that links to where you want. I haven't tried using an empty content type for this purpose however, I've only used an empty content type as a nodefamily head.
2) Another approach is to modify the pageroute code. The rubber meets the road in the function "pageroute_page_form_submit_redirect" round about line 213 at the time of this writing, in the "case PAGEROUTE_FORWARD" code. I found in DBG that when the code reached here, the $_REQUEST didn't have a destination anymore, so my pageroute was circling back to the start of itself. However, if you properly rearrange the encompassed condition, and do some poking around in the $page you can determine what pageroute you're on, and determine if you want to commandeer the $_REQUEST's destination. I did this successfully as a quick hack for a demo. But it's really a hack. Here's how it might look.