23376 Posts in 18218 Topics by 2867 members
|Go to End|
21 September 2010 at 8:02am
Hopefully this is an easy one that I just can't seem to find...
If you are using hierarchical urls in 2.4 what function(s) would you use to get the full path. For example if you have yoursite.com/Parent/Child/Grandchild how would return the full path. I've been looking at Director functions, but I can only get them to return the beginning and the end of the full URL i.e. yoursite.com/parent or child/grandchild. I was using baseurl and urlParams respectively. What simple thing am I missing?--I want to be able to redirect to yoursite.com/Parent/Child/Grandchild/insert-page-here with Director::redirect()
Thanks in advance!
21 September 2010 at 8:47am
If you've got the page already, $page->Link(), otherwise SiteTree:get_by_link('insert-page-here')->Link(), however that'll only work if 'insert-page-here' is a unique URLSegment.
21 September 2010 at 9:34am
SiteTree:get_by_link('insert-page-here')->Link() was exactly what I was looking for.
|Go to Top|