Page 1 of 1

Some problems with cms selflink in news

Posted: Sun Aug 19, 2018 6:30 pm
by gianpiero
Hi all

I have a problem to apply a cms selflink inside the news

The link to an internal page doesn't work, when I check the SOURCE CODE appears :

Code: Select all

<a href="{cms_selflink href='my-page-alias'}">text for calling internal link</a>
But when the news is published the link is:

Code: Select all

[code]https://mysite.org/%7Bcms_selflink%20href='my-page-alias'%7D
[/code]

and doesn't work

The cms selflinks function works on normal pages

The site is a 2.2.8 fresh installing

Is it a problem related to the summary template ? Any suggestion to check something ?

Thanks

Re: Some problems with cms selflink in news

Posted: Sun Aug 19, 2018 7:11 pm
by DIGI3
If you take a look at the default News templates, you'll see a comment like:

Code: Select all

{* note, for security purposes, incase News articles can come from untrused sources, we do not pass the summary or content through smarty in the default templates *}
If you trust all admins and do not allow frontend users to post News articles, you can use 'eval' to parse through Smarty, e.g.

Code: Select all

{eval var=$entry->summary}

Re: Some problems with cms selflink in news

Posted: Sun Aug 19, 2018 7:20 pm
by gianpiero
Thank for you reply

At this moment I have , for example

Code: Select all


<div class="NewsSummarySummary">
{$entry->summary}
</div>
I have to modify

Code: Select all

<div class="NewsSummarySummary">
{eval var=$entry->summary}
</div>
is it correct ?

Re: Some problems with cms selflink in news

Posted: Sun Aug 19, 2018 7:30 pm
by DIGI3
Yep, and the detail one as well. Anywhere it's not getting eval'd and you want it to.

Re: Some problems with cms selflink in news

Posted: Sun Aug 19, 2018 7:58 pm
by gianpiero
working, thank you very much ;D