Search

I've just noticed that I can use variables (such as {$root}) when creating data entries, and they will be replaced in the generated webpages.

Is this a safe practice, or is this something that is not supposed to happen (and that may stop working in future versions)?

Never mind... This doesn't work.

what are you trying to achieve? reflection field and entry url field are two particular extensions that allow you to use some variables and xpath to create an entry field.

In some HTML data entries I have links to other pages. I wanted to be able to write the URL of link with something like href="{$root}/foo/" instead of href="http://mydomain.com/dir/foo/". That would allow me to move my webpage without invalidating links. The solution doesn't have to rely on variable, but I think this kind of feature would be useful.

You should definitely check out the Ninja technique. Might look a little scary at first, but it's worth learning.

Can't you simply make all URLs relative to /? You could consistently prepend {$root} in your XSLT if / should actually be /my/new/site/.

Edit: Eh, yeah. And then use Ninja Technique to do that. :-)

I'll try the Ninja technique. It seems a good method to solve this problem.

(I guess I could also check in the XSLT if the URLs are relative, and in that case, prepend the {$root}, but I'll try first the Ninja technique with explicit variables in the URLs.)

Thanks.

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