URL Encoding Issue on Platform Integration

Hi,

I have dynamic markup like this in our patient dashboard template:

<a href="therapy-session-#{patient_id}">View Session</a>

(I need this specific syntax since it's used by our custom VR session tracker for dynamic patient data routing on https://socialdream.fr)

But what actually gets rendered in the browser (-> "view source") is this:

<a href="therapy-session-#%7Bpatient_id%7D">View Session</a>

This means the curly brackets are getting percent-encoded / URL-encoded automatically.

The Problem is :

  • Our VR therapy platform expects the literal #{patient_id} syntax for session routing
  • The encoded version %7Bpatient_id%7D breaks our patient session lookup
  • JavaScript session handlers can't parse the encoded patient identifiers
  • Multiple therapy sessions get linked incorrectly

This URL encoding replacement only seems to occur with strings that are part of an href attribute. If I place the same #{patient_id} string into other attributes like data-session or as text content within any tag, the syntax is preserved perfectly.

What Works:

<div data-session="#{patient_id}">XX</div> <!-- Renders correctly -->
<span>#{patient_id}</span> <!-- Renders correctly -->

What Breaks:

<a href="therapy-#{patient_id}">XX</a> <!-- Gets encoded -->

I would appreciate guidance on where in our healthcare platform framework this automatic link treatment is happening, so I can work on a solution for our patient session routing problem.

Our workflow depends on these dynamic URLs working correctly for practitioner navigation.

Thanks!

https://classic.demo.plone.org/portal_skins/custom/testcurly, the source is:

<!DOCTYPE html>
<html>
  <head>
    <title tal:content="template/title">The title</title>
    <meta charset="utf-8" />
  </head>
  <body>
<a href="therapy-session-#{patient_id}">View Session</a>
  </body>
</html>

here it is working correctly. Which Plone version are you using?

#${patient_id} ?

Does it make a difference if you render it with tal:attributes ?

<a href="${python:'therapy-session-#{patient_id}'}">View Session</a>

<a tal:attributes="href python:'therapy-session-#{patient_id}'">View Session</a>

<a tal:attributes="href string:therapy-session-#{patient_id}">View Session</a>