If you mean changing the url's of the inserted internal links (e.g. {localLink:1234}) then I can see that this would be more tricky.
The way it works is this: Once the html for the page is about to be rendered to the response stream (default.aspx.cs - Render()) a call is made to template.ParseInternalLinks(). This changes the localLink syntax to the correct url.
So either you can put your own default page in place, extending the one that's there and change this method. OR. you can change the way you are outputting the RTE generated content and replace the localLink:1234 text at this point.
How to customize niceurl
hello,
I have now made a umbraco site with url's like /da/frontpage.
How can i set the function "Niceurl" to se a / after the link automaticly?
Regards Anders
Hi Anders,
There are a couple of ways to do that.
In XSLT, you could use:
or in .NET code, you could create your own wrapper for the method:
Let me know how it goes.
Cheers,
- Lee
I would like to edit the niceurl function, so it's allso work in the editor.? Is that possible?
Hi Anders,
What doesn't work in the editor (tinyMCE)?
If you mean changing the url's of the inserted internal links (e.g. {localLink:1234}) then I can see that this would be more tricky.
The way it works is this: Once the html for the page is about to be rendered to the response stream (default.aspx.cs - Render()) a call is made to template.ParseInternalLinks(). This changes the localLink syntax to the correct url.
So either you can put your own default page in place, extending the one that's there and change this method. OR. you can change the way you are outputting the RTE generated content and replace the localLink:1234 text at this point.
I'd go with the latter suggestion. So rather than
You would have something like
The current Parse method is this
you just need to create the xslt extension, copy in the code above and modify the NiceUrl call as you wish.
Enjoy,
Chris
Thanks for that. That would say that i could make the links to wath i wish to fx /page(id).aspx and so on?
Regards Anders
And where is the .cs'files?
Sorry Anders, I don't follow what you're asking. Can you expand?
The solution I posted should allow you to change the output URL to any structure you wish.
You would need to implement this solution yourself (writing your own C# and xslt extension).
Can't you just do this using some juicy jquery that parses all a tags and adds a trailing slash? No need for core code modifications?
Cheers,
/Dirk
Think about accessibility and search engines... javascript would need to be ruled out for both.
If the localLink parsing happens via an xsltExtension then there's no need for core code modifications.
On a side note - The parsing and loading of macros could also be brought foward into the xslt processing stages... therefore avoiding situations like http://our.umbraco.org/forum/templating/templates-and-document-types/4059-Including-user-control-in-rendered-list-of-eg-expo-boxes-or-news
is working on a reply...