abedia Posted February 5, 2016 Share Posted February 5, 2016 Kind of new to the process wire environment. I've tried for hours to figure this out. I want a menu entry (page) that goes to an external site. This seems to be much easier said than done. I made a field called redirectTo of type URL. I added it to a template I made called redirectPage. In the redirectPage.php, this is what I put: <?php $session->redirect( $page->redirectTo->url ); ?> Apparently this isn't good enough, or I'm just doing something wrong. Forgive any ignorance on my part. All it seems to want to do is redirect to itself over and over again, or something. I even tried changing it to something like... <?php echo $page->redirectTo->url; ?> I don't remember if this was the exact thing I tried, but it just returns nothing. Can someone help me here? I was trying to base it off of this, but it just does not work for me: https://processwire.com/talk/topic/341-uri-redirect/ Thanks all. Link to comment Share on other sites More sharing options...
adrian Posted February 5, 2016 Share Posted February 5, 2016 In this case you probably just want: $session->redirect( $page->redirectTo ); because a URL field doesn't have a url property - it's just a string. 1 Link to comment Share on other sites More sharing options...
abedia Posted February 5, 2016 Author Share Posted February 5, 2016 Holy frick, thank you. That does exactly what I want. I've been fiddling with this crap for hours. Link to comment Share on other sites More sharing options...
adrian Posted February 5, 2016 Share Posted February 5, 2016 Holy frick, thank you. That does exactly what I want. I've been fiddling with this crap for hours. No problem at all. Welcome to the forums btw. I am sure it will all start to make sense very soon! 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now