I have textpages set up adjacent to each other at various spots in the document tree. I would like to be able to specify the relative path so that computing the full path is not needed. For example consider this document tree:
My Event
Info
Register
My Other Event
Info
Register
If relative url's are permitted on each of the Info pages, I can have a simple link to "Register/" instead of having to figure out the full path. IE "/My-Event/Register/" and "My-Other-Event/Register" respectively.
I am new to Umbraco, so its possible I am not seeing something. But lets say that these are simple textpage documents. How would you use the NiceUrl extension? It seems to me that to use the niceurl extension you would have to have a specific xslt, user control (macro) or master page (template) involved somewhere.
Well if you want to make simple textpage documents I'm not sure I get why you're using a CMS to handle the content if you don't benefit from the options you have by doing so?
Yes you're right that it would require a XSLT macro...you can probably also generate the navigation using Razor or some user control using the same extension I suppose.
It should be fairly easy for you to create an XSLT macro with some simple navigation for your page since there are some predefined snippets you can choose from, when creating a XSLT macro in the developer section. I bet it will take you less than 5 minutes to get it working, which is much faster than trying to make tinymce create relative url I guess :-)
While I am trying to keep this one little section simple, it doesn't mean the rest of the site isn't going to be more involved. And certainly, creating an xslt macro or something similiar would not take very long, but it would limit the flexibility. If Umbraco's WYSIWYG would simply not rewrite the link, the solution would be even quicker than creating a little macro.
So motivation aside, is there a way to prevent this behavior?
I must have been drunk or something when I answered this post last night.
Please do forget what I wrote about using umbraco.library:NiceUrl on urls entered into the rich text editor field - Links from rte will be just be written out when fetching the contents from that field. Sorry about the confusion :-)
Still don't know how to make a workaround though...
I must be missing something here, but if you highlight "Click here" and click the "Insert/edit link" button, then choose a page in your tree, it should create the correct link regardless. No need to manually construct the href..
That said, I have no idea as to why tinyMce adds the extra slash, I think it's got to do with some kind of obscure html compliance thing.
What your describing works perfectly. What I am describing is a situation where the user manually enters the link's url. The point of all this is that I want a relative url not an absolute one. Specifically I am going to have alot of content that is largely the same is going to be copied from place to place and I dont want to have to write code to fix the url's after the copy.
Just wondering, has anyone been able to resolve this issue? Here's an example url that get's auto-corrected and breaks things: <a href="skype:skype_username?call"></a> get converted by TinyMCE into <a href="/skype:skype_username?call"></a> (and obviously will no longer launch skype and start a call... worse - it pops up an error message page when user clicks onto it.
So far two things come to mind:
Hard code it into the template it self where TinyMCE not all powerful. But giving our content editor access to the templates makes the my heard stand up.
Use non WYSIWYG data type - our content editor doesn't know html :(
Use javascript to remove it on the page it self... Again, ugly, ugly ugly...
Surely, there must be a way to override this behaviour?
There is a TinyMCE config that will change this behaviour. In config/tinyMceConfig.config, add this to the <customConfig> section at the end of the file:
How to prevent the WYSIWYG from rewriting link href attribute
When I enter the following html into the WYSIWYG editor:
<a href="thank-you/">Click here</a>
it changes it to
<a href="/thank-you/">Click here</a>
That is to say it is making my perfectly valid relative url into a root relative url. How can I prevent this?
Hi greengiant
Why do you want to prevent it?
/Jan
I have textpages set up adjacent to each other at various spots in the document tree. I would like to be able to specify the relative path so that computing the full path is not needed. For example consider this document tree:
Figure out? Isn't that just a matter of using the umbraco.library:NiceUrl extension? Or am I missing something?
:-)
/Jan
I am new to Umbraco, so its possible I am not seeing something. But lets say that these are simple textpage documents. How would you use the NiceUrl extension? It seems to me that to use the niceurl extension you would have to have a specific xslt, user control (macro) or master page (template) involved somewhere.
Well if you want to make simple textpage documents I'm not sure I get why you're using a CMS to handle the content if you don't benefit from the options you have by doing so?
Yes you're right that it would require a XSLT macro...you can probably also generate the navigation using Razor or some user control using the same extension I suppose.
It should be fairly easy for you to create an XSLT macro with some simple navigation for your page since there are some predefined snippets you can choose from, when creating a XSLT macro in the developer section. I bet it will take you less than 5 minutes to get it working, which is much faster than trying to make tinymce create relative url I guess :-)
Hope this helps - otherwise just let us know :-)
/Jan
While I am trying to keep this one little section simple, it doesn't mean the rest of the site isn't going to be more involved. And certainly, creating an xslt macro or something similiar would not take very long, but it would limit the flexibility. If Umbraco's WYSIWYG would simply not rewrite the link, the solution would be even quicker than creating a little macro.
So motivation aside, is there a way to prevent this behavior?
There probably is a way to do it but I must admit that I don't know how. But I suspect you would perhaps need to look in the source for tinyMce...
Maybe some others know extactly where to look for this...but I'm really not sure it's worth the effort :-)
/Jan
Hi again
I must have been drunk or something when I answered this post last night.
Please do forget what I wrote about using umbraco.library:NiceUrl on urls entered into the rich text editor field - Links from rte will be just be written out when fetching the contents from that field. Sorry about the confusion :-)
Still don't know how to make a workaround though...
/Jan
I must be missing something here, but if you highlight "Click here" and click the "Insert/edit link" button, then choose a page in your tree, it should create the correct link regardless. No need to manually construct the href..
That said, I have no idea as to why tinyMce adds the extra slash, I think it's got to do with some kind of obscure html compliance thing.
Sebastiaan,
What your describing works perfectly. What I am describing is a situation where the user manually enters the link's url. The point of all this is that I want a relative url not an absolute one. Specifically I am going to have alot of content that is largely the same is going to be copied from place to place and I dont want to have to write code to fix the url's after the copy.
Just wondering, has anyone been able to resolve this issue? Here's an example url that get's auto-corrected and breaks things: <a href="skype:skype_username?call"></a> get converted by TinyMCE into <a href="/skype:skype_username?call"></a> (and obviously will no longer launch skype and start a call... worse - it pops up an error message page when user clicks onto it.
So far two things come to mind:
Hi all,
There is a TinyMCE config that will change this behaviour. In config/tinyMceConfig.config, add this to the <customConfig> section at the end of the file:
Lesley
// removing my double post - sorry!
is working on a reply...