Jump to content

output file name - anchor


wishbone
 Share

Recommended Posts

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

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>";

  • Like 1
Link to comment
Share on other sites

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

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

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? :ph34r:

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

  • Like 2
  • Haha 1
Link to comment
Share on other sites

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

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.

  • Like 1
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...