Search

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?

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.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details