Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
[SOLVED] ampersands in urls and validation
I would like to link to a particular url with an ampersand in it. The url is
http://mitpress.mit.edu/catalog/item/default.asp?ttype=2&tid=13140
As we know the above causes xhtml to fail. I have tried
http://mitpress.mit.edu/catalog/item/default.asp?ttype=2&tid=13140
,
http://mitpress.mit.edu/catalog/item/default.asp?ttype=2&tid=13140
and
http://mitpress.mit.edu/catalog/item/default.asp?ttype=2\x26tid=13140
but the page returns the following error
Microsoft VBScript runtime error ‘800a000d’
Type mismatch: ‘aEditionDetails’
/catalog/item/default.asp, line 1452
Can anyone suggest a valid xhtml alternative?
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: [SOLVED] ampersands in urls and validation
There you go:
Code:
<a href="http://mitpress.mit.edu/catalog/item/default.asp?ttype=2&tid=13140">
Illusions in Motion
</a>
Or in Textile:
"Illusions in Motion":http://mitpress.mit.edu/catalog/item/default.asp?ttype=2&tid=13140
Offline
Re: [SOLVED] ampersands in urls and validation
Hi Jukka,
I am using custom_filelds, not textile and when I type http://mitpress.mit.edu/catalog/item/default.asp?ttype=2&tid=13140
it returns the error above. Try to go to it and you will see.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: [SOLVED] ampersands in urls and validation
Looking at it again, it is strange. Using textile the ampersand is encoded the the link does go there (from this forum), but without the textile, ie using
<a href="http://mitpress.mit.edu/catalog/item/default.asp?ttype=2&tid=13140">
Illusions in Motion
</a>
the link returns the error page.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: [SOLVED] ampersands in urls and validation
colak wrote:
I am using custom_filelds, not textile and when I type
http://mitpress.mit.edu/catalog/item/default.asp?ttype=2&tid=13140
Custom fields already do escaping for you. Please see escape attribute. The following generates valid HTML when the custom field contains http://example.com/?foo=1&bar=1
:
<a href="<txp:custom_field name="publisher_link" />">
<txp:custom_field name="publisher_link" />
</a>
If you need to use HTML within a custom_field itself, set the escaping off (escape=""
).
Last edited by Gocom (2012-07-31 16:49:58)
Offline
Re: [SOLVED] ampersands in urls and validation
Gocom wrote:
Custom fields already do escaping for you.
Indeed they do and I did have the escape attribute but forgot about it so I was adding the amp;
after the &
which is what was messing up the url destination. Thanks Jukka. Problem solved.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline