wishbone Posted May 31, 2013 Share Posted May 31, 2013 stupid question: want to link to an anchor on the tearget file. What is the name of the output file? I tried to guess, but /site/category/output/index.php isn't it, nor is site/category/output.php... Link to comment Share on other sites More sharing options...
horst Posted May 31, 2013 Share Posted May 31, 2013 So, you should already know the targetfile, because you write the link ?? ok ?? (something like $targetpage->url) Now you only have to append your anchorname: <?php echo "<a href='{$targetpage->url}#anchorname'>MyLink</a>"; 1 Link to comment Share on other sites More sharing options...
wishbone Posted May 31, 2013 Author Share Posted May 31, 2013 thx! but I want it hardcoded, absolute URL... Link to comment Share on other sites More sharing options...
diogo Posted May 31, 2013 Share Posted May 31, 2013 You want it hardcoded or absolut? because they are different. You can have a dynamic absolute like this rtrim($config->urls->root, "/").$page->url; // rtrim removes the trailing slash from the root url or, if you really want it hardcoded (I can imagine you need it for javascript), you can view the page and copy the url, or just echo that code and copy the result Link to comment Share on other sites More sharing options...
wishbone Posted May 31, 2013 Author Share Posted May 31, 2013 thank you! that only throws me, again, a folder. I need the hardcoded absolute path and file name... I want to link to an anchor on the target page. I can't link to /site/category/output/#anchor Link to comment Share on other sites More sharing options...
diogo Posted May 31, 2013 Share Posted May 31, 2013 I can't link to /site/category/output/#anchor How come not? Works with me on every browser I tried... 1 Link to comment Share on other sites More sharing options...
Macrura Posted May 31, 2013 Share Posted May 31, 2013 @wishbone what about setting the template to not use trailing slash Link to comment Share on other sites More sharing options...
horst Posted May 31, 2013 Share Posted May 31, 2013 thank you! that only throws me, again, a folder. I need the hardcoded absolute path and file name... I want to link to an anchor on the target page. I can't link to /site/category/output/#anchor Hhm, what's exactly the problem? Have you tried the suggestions? What is the exact URL of your targetpage? --- Do you know the exact URL? [ ] YES [ ] NO If you have answered the above question with yes, your solution is as follows: - please type the known URL followed by a # and the anchorname exactly into the href of your link 2 1 Link to comment Share on other sites More sharing options...
wishbone Posted May 31, 2013 Author Share Posted May 31, 2013 How come not? Works with me on every browser I tried... ok, yes, now works, sorry, don't know why... I was confused because I don't have a file name. Could you pls explain me the concept how the page is displayed if not a file? Link to comment Share on other sites More sharing options...
diogo Posted May 31, 2013 Share Posted May 31, 2013 The file displayed is always index.php, but the content being rendered depends on the url. It's like when you have a query string, like in domain.com/index.php?field1=value1&field2=value2&field3=value3, in that case all those pairs field/value can be pulled by get, and the content displayed can vary depending on them. Except that here, normal URLS are redirected to index, and via the URL segments the right page is displayed via some PW magic. I don't know exactly how it works, but maybe someone more informed can explain the details. 1 Link to comment Share on other sites More sharing options...
wishbone Posted May 31, 2013 Author Share Posted May 31, 2013 PW magic Yes !! Well thank you, it's not important, only to understand the concept... 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