I want to replace all the url's in the content. For example I want to change /nl/test into #!/nl/test. I wrote an XSLT extension for this, but the problem is that the interal url's are in a strange format. If I link to another page in the RTE the link is this: /{localLink:1100}. Somehow the link is displayed correct and if I look at the source it's changed into /nl/test. The problem is that the link won't be updated if I change the url. Here is a test XSLT extension:
public static string ReplaceHtmlUrls(string html)
{
return html.Replace("/{localLink:1100}", "#!/{localLink:1100}");
}
Now the href attribute is changed into '#!/{localLink:1100}', but it should be '#!/nl/test'. So it only works if I don't replace it... Any idea how to solve this?
Thats a good alternative. Thanks! Offcourse it would be better if I could just add the #! to the /{localLink:1100} part so I wouldn't have to call the nice url method.
Replace all url's in content with XSLT extension
Hello,
I want to replace all the url's in the content. For example I want to change /nl/test into #!/nl/test. I wrote an XSLT extension for this, but the problem is that the interal url's are in a strange format. If I link to another page in the RTE the link is this: /{localLink:1100}. Somehow the link is displayed correct and if I look at the source it's changed into /nl/test. The problem is that the link won't be updated if I change the url. Here is a test XSLT extension:
Now the href attribute is changed into '#!/{localLink:1100}', but it should be '#!/nl/test'. So it only works if I don't replace it... Any idea how to solve this?
Jeroen
Couldn't you parse out the ID portion, use NiceURL to get the URL and append it to "#!" ?
Hi Tom,
Thats a good alternative. Thanks! Offcourse it would be better if I could just add the #! to the /{localLink:1100} part so I wouldn't have to call the nice url method.
Jeroen
Anyone else got a good suggestion for this or should I just replace the url's manually?
Jeroen
is working on a reply...