adrianmak Posted January 19, 2015 Share Posted January 19, 2015 My pw is installed under a sub-folder i.e http://localhost/pwtest i just created a frontend user login page. The url path is /user/login in the main template I have hard-coded a login link <a href="user/login">Sign in</a> At the homepage, the login url look good, it will show http://localhost/pwtest/user/login However when I go to another page say a contact page http://localhost/pwtest/contact When hover the login link, it changed to http://localhost/pwtest/contact/user/login and it is not a correct link Link to comment Share on other sites More sharing options...
Nico Knoll Posted January 19, 2015 Share Posted January 19, 2015 use: <a href="<?php echo $config->urls->root; ?>user/login">Sign in</a> 1 Link to comment Share on other sites More sharing options...
LostKobrakai Posted January 19, 2015 Share Posted January 19, 2015 The more flexible way would be to not hardcode anything, like this. <a href="<?php echo $pages->get("template=login")->url; ?>">Sign in</a> 8 Link to comment Share on other sites More sharing options...
vxda Posted January 19, 2015 Share Posted January 19, 2015 Im using : <a href="<?php echo $pages->get(ID_OF_PAGE)->url; ?>"> <?php echo $pages->get(ID_OF_PAGE)->title; ?> </a> This way i get page that i want, i can change its name and title from inside admin panel. This way i dont have to go in code every time i want change title or parent of the page 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