Search

I’m not sure if this is a server rather than a Symphony question. I was not able to find a solution in the forum for a problem I currently have regarding umlaute (öäüÖÄÜ + ß) in query strings.

The keyword f. e. gaststätte is submitted nicely via GET-form. However, if I use a query-string in a regular href link it turn to gaststätte.

Sorry if this is a noob-question, but after being spoiled by proper urls in symphony I am kind of lost here. I tried the encode/decode thingy here but to no avail :(

I’d appreciate any hint! Thanks in advance.

Actually URL encoding is rather complicated in XSLT. :-(

It is one of the rare occasions for me to use PHP in XSLT, i.e register the corresponding PHP functions urlencode and rawurlencode. (There is an extension for registering PHP functions. I forgot the name, because I do it in a custom extension.)

You can then do things like this:

<a href="{concat('mailto:?subject=', php:function('rawurlencode',string(normalize-space(titel))), '&amp;body=', php:function('rawurlencode',string(text)))}">Send email</a>

Again, I am not a big fan of using XSLT in PHP, generally. But this is the exception to the rule.

Thanks Michael, this looks rather pragmatic. Will try this!

there is also an xslt url-encoding template in the download section

Thanks again. Encoding works great now, but the search index extension does not decode the query string afterwards :( Since Umlaut-containig keywords work fine in GET form data I’m assuming changing the code in the extension might break that part. Will try and see.

Update: after a lot of troubleshooting dead-ends I found out that all the Umlauts work fine … what made things break was a missing / before the initial ? of the query-string in my regular link. (Will have to check if this works in older browsers too, fingers crossed!)

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