Relative/abs linking in text areas in multiple environments
This is an open discussion with 2 replies, filed under Troubleshooting.
Search
I'll have to take a closer look at your solution. I've done something similar Redirecting internal links to $root URL with xsl:apply-templates and managing internal links within entries, based on Allen's ideas. Looks like you're doing the same thing with slightly different XSL techniques.
Ah yes. Very nice. ;)
Create an account or sign in to comment.
I just stopped by the irc channel to bug the developers and friends about a curious question. I was wondering if there's a way to evaluate PHP variables inside text areas.
Alistair, of course, had a good answer: that I needed to create a filter that would evaluate the string.
Seeing as that seemed too difficult (haha), I decided to be less cryptic. The reason I needed those variables was that I was linking files and images through the article entry (text area). For example:
The issue is that in the development environment, I don't have the web site in the document root of the server. As such, I would get broken anchors or images.
An alternative solution is to do some Ninja XSLT:
Basically, this looks for all anchors and images that href or src, respectively, begin with a "/" and replaces their respected attribute values with the $root variable available to all XSLT stylesheets.
Hope it helps someone else. If someone, cough Allen, has a better solution, it'd be great if I could see it.