cms_selflink will not output link on all pages

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
jpa
Forum Members
Forum Members
Posts: 10
Joined: Wed Jun 17, 2009 11:31 am

cms_selflink will not output link on all pages

Post by jpa »

I have an issue with cms_selflink within the normal page contents.

On most pages, links like:

Code: Select all

<a href="{cms_selflink href='alias'}">
Works fine, and output the full correct URL to this page. But on some pages, this is the result:

Code: Select all

https://my.site.no/%7Bcms_selflink%20href='alias'%7D
The pages use the same design and template. The content uses the MicroTiny editor, and I notice that when I hover the link in MicroTiny, I see the above, not converted, link. But on most pages the preview is OK. But not on all pages. I've tried to edit the link and page, but it does not help.

I just upgraded to the latest version 2.2.14 (from 2.2.12). The content itself was earlier upgraded from an old 1.11.* version a few months back. It could be that this error occurred then. But why is it not working post editing on this pages?

I found an older post with this issue regaring the News module, but the cms_selflink works fine in the News module of my CMS. And since it works fine on most content pages, I cannot see that this solution is helpful here.
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3292
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: cms_selflink will not output link on all pages

Post by velden »

If you disable the wysiwyg editor (MicroTiny) for a problematic page (Options tab); do you see the un-encoded {cms_selflink href='alias'} or the encoded %7Bcms_selflink%20href='alias'%7D?

You could then fix it in the html code and enable the wysiwyg editor afterwards
jpa
Forum Members
Forum Members
Posts: 10
Joined: Wed Jun 17, 2009 11:31 am

Re: cms_selflink will not output link on all pages

Post by jpa »

Thank you for your replay.

When I disable WYSIWYG (or view HTML source) I see the un-encoded tag: <a href="{cms_selflink href='alias'}"> on every occation.

When I save the page with disabled WYSIWYG and view the page, the links are still encoded like %7Bcms_selflink%20href='alias'%7D
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1058
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: cms_selflink will not output link on all pages

Post by DIGI3 »

On the pages where it isn't working, are they using the same page template as the ones where it works? If you add another Smarty tag in the same content block as the link does it get processed, or are they all skipping Smarty evaluation? Try {$smarty.now} or something as a test.
Not getting the answer you need? CMSMS support options
jpa
Forum Members
Forum Members
Posts: 10
Joined: Wed Jun 17, 2009 11:31 am

Re: cms_selflink will not output link on all pages

Post by jpa »

Just found the culprit. Saw it when I took another look at the source code.
One way or another the whole page content was put inside a

Code: Select all

{literal}
tag. I removed this tag and put it around only the text that needed it.

And violà!

Thanks for all your suggestions. I'll get new glasses and show myself out 🙂
Post Reply

Return to “CMSMS Core”