Site-Internal Links
This is an open discussion with 3 replies, filed under General.
Search
I think you mean like Rails' link_to view helper or Zend's url() helper method, where you can pass a page name (route name) and parameters to build the URL?
No, unfortunately not.
It is technically possible though. Check out #2 in this presentation. Using the EXSLT Function Manager extension you could expose a php:url()
method in XSLT, such as:
<xsl:value-of select="php:url('Articles', title/@handle)"/>
The meat of this PHP function would look up a page named Articles to find its handle (e.g. /articles/
), it would then see that the page has one URL parameter and would append the title handle to it, resulting in:
/articles/my-article-handle-here/
This means that your route names (page names) remain consistent but their handles can change.
It feels like quite a lot of effort. Although I've used the view helpers in other frameworks, I have very rarely ever had to change URLs, so I can't say it has ever saved me time.
Okay, that's something to consider. I wonder if the markdown will recognize such as valid links to create hrefs out of it properly, but it's a direction. Thanks for the feedback!
Oh I see, you're also adding these links inside Markdown? My suggestion above was just when you're building hyperlinks directly in your XSLT.
Create an account or sign in to comment.
Does Symphony CMS offer something to produce site-internal links?
Something like the reverse of Pages, so to specify a datasource / page and the System ID of it which will in turn create links?
So I can link between multiple pages while being able to change things?