We're making use of WYSIWYG type metadata fields but I've noticed a small-ish issue when it comes to linking to assets.
In the contents of, say, a Standard Page asset, links of the form
[html]<a href="./?a=1234">Link text</a>[/html]
are usually replaced on the front-end with the correct relative Web Path for that asset.
In metadata, however, it seems that the anchor tag's href isn't automatically replaced in this way. This creates a link something like:
[html]<a href="/path/to/current/asset?a=1234">Link text</a>[/html]
I'm creating these links using the Add Link tool in the WYSIWYG editor, and we're on Squiz MySource v3.22.1 (Matrix).
We've scheduled an upgrade so I wonder if this has been resolved in a more recent version?
I believe this is resolved in 4.0.0. In the meantime, you could use %globals_asset_url:X%, though that is a little more inconvenient… :unsure:
Thanks Dan,
that should be helpful until then!
[quote]
In metadata, however, it seems that the anchor tag’s href isn’t automatically replaced in this way. This creates a link something like:
[html]<a href="/path/to/current/asset?a=1234">Link text</a>[/html]
[/quote]
This is actually expected behaviour, only bodycopies have the ability to replace these links properly. And at the moment, it is not in 4.0.0.
See Bug #4100 for details
Hrm… that's strange, I swear I saw a commit for that. Maybe I dreamt it …
[quote]
This is actually expected behaviour, only bodycopies have the ability to replace these links properly. And at the moment, it is not in 4.0.0.
See Bug #4100 for details
[/quote]
No, I’m not going mental. I just tested this in a HEAD system. If you use <a href="./?a=X" in a news item bodycopy, it gets replaced with a hyperlink. I can’t find the commit message (it’s a bit difficult to search for special characters).
It also only seems to work with href="./?a=X", so <img src="./?a=X" still doesn’t work.
[quote]
No, I’m not going mental. I just tested this in a HEAD system. If you use <a href="./?a=X" in a news item bodycopy, it gets replaced with a hyperlink. I can’t find the commit message (it’s a bit difficult to search for special characters).
It also only seems to work with href="./?a=X", so <img src="./?a=X" still doesn’t work.
[/quote]
While the OP, is using metadata wysiwyg, you are correct. It was filed on a different bug report #4573 but it seems to be HEAD (or 4.0.0) only.
Cool, I didn't dream it!
Since the replacement happens on the generated output before sending the data to the browser, it doesn't matter where the ./?a= link appears (in a news item, metadata wysiwyg or whatever), it will get replaced.
Now we're all looking forward to 4.0.0 ! 