I added the Token context (with a %keyword of '%token') to a panel, because I want to use the [site:url] token in a custom pane title.

Let's say:

Site url token value = http://localhost/siteroot/ (notice this comes with a trailing slash)

Using the normal token syntax outside of Panels, it'd be constructed like this:

<a href="[site:url]path/of/mine">My Path</a>

Which comes out as:

<a href="http://localhost/siteroot/path/of/mine">My Path</a>

But using Panels' substitution syntax:

<a href="%token:site:urlpath/of/mine">My Path</a>

gives a broken link:

<a href="http://localhost/of/mine">My Path</a>

And the only way I could get it to create a usable path was:

<a href="%token:site:url/path/of/mine">My Path</a>

Which outputs a syntactically incorrect URL (which works on most browsers):

<a href="http://localhost/siteroot//path/of/mine">My Path</a>

Notice the double slash "//" there between the token value and the rest of the static text.

IS there an existing way to prevent this or workaround it, like some secret syntax that "caps" substitution keywords? Why can't Panels use the normal [token:value] syntax, come to think of it?

I'm forced to enter some kind of separator character to stop recognition of a keyword, and that gets in the way in the above situations.

Comments

amaisano created an issue. See original summary.

amaisano’s picture

Issue summary: View changes