Page 1 of 1
WYSIWYG editor add %20 to links
Posted: Wed Dec 18, 2013 10:54 pm
by luppa
I have a lot of links of type {cms_selflink href='page' anchorlink='anchor'} on my page. Just the {cms_selflink href='page'} seems to work fine, but if add the anchorlink, the WYSIWYG editors put %20 in the spaces. Then the whole page gives out an error.
I would just use html, but my client wants to use some type of WYSIWYG. First I tried the MicroTiny that came with the fresh install. with that, if I edit the link in WYSIWYG, the %20's keep being added. Then I installed TinyMCE, which I would prefer over MicroTiny, but it's even worse: if I edit something (_not_ the links) on the page and save, all the links magically change.
Any suggestions?
Re: WYSIWYG editor add %20 to links
Posted: Thu Dec 19, 2013 8:02 pm
by JohnnyB
The %20 is because there are spaces in the URL. I've seen this happen most often when installed on a Windows based server (WAMP) and especially if the client needs to link to images or documents located on the server.
I did have a client with the above situation (WAMP and trying to link to files on their local server with spaces in the name) that was resolved by changing the character encoding.
Re: WYSIWYG editor add %20 to links
Posted: Sat Dec 21, 2013 12:17 am
by luppa
JohnnyB wrote:The %20 is because there are spaces in the URL. I've seen this happen most often when installed on a Windows based server (WAMP) and especially if the client needs to link to images or documents located on the server.
I did have a client with the above situation (WAMP and trying to link to files on their local server with spaces in the name) that was resolved by changing the character encoding.
I think I got misunderstood. The %20's are not added serverside. The wysiwyg editor adds them, on the client browser side.
The thing that's happening is, if I select a part of text, then use a tool to make an in-site-link, the result looks like this:
{cms_selflink href='page'}
And that works just fine! But I have those anchors, that I want to use. So, with the editor, I edit the link, to add the anchor point, like so:
{cms_selflink href='page' anchorlink='anchor'}
But after editing, it has changed to:
{cms_selflink%20href='page'%20anchorlink='anchor'}
CMSMS doesn't like that. The whole page goes down with an error. If I use tinyMCE for editing, I won't even have to edit any links - the %20's magically appear to
all the links with anchorlink defined on the page.
The link itself, the link that get's generated by that cms_selflink code, does not contain any spaces. I am not trying to point to any files or directories that have spaces in their names.
Re: WYSIWYG editor add %20 to links
Posted: Sun Dec 22, 2013 9:22 am
by velden
{cms_selflink
href=} suggests your building the links yourself:
<a href="{cms_selflink href="pagealias"}"> link text </a>
From that point of view it seems okay for tinyMCE to convert spaces to %20. Apparently TinyMCE does not recognize the smarty tag.
have a look at Extensions -. TinyMCY --> Advanced (Tab):
Avoid link conversion:
Turns TinyMCE's builtin link conversion logic off. Makes {smarty}-usage in urls possible.
Re: WYSIWYG editor add %20 to links
Posted: Mon Dec 23, 2013 3:46 am
by JohnnyB
When editing CMSMS tags - anything between the curly brackets {} - I almost always disable the WYWIWYG editor, which is also called, "HTML View", because the editor can corrupt tags by doing things like that.