News with cms_selflink not working

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.
Locked
rooon
Forum Members
Forum Members
Posts: 113
Joined: Mon Dec 05, 2011 4:40 pm

News with cms_selflink not working

Post by rooon »

Hi all,

I'm creating a website www.vencontra.com

Frontend
On the home page you'll find 16 image links using a News Summary template. If you click on the "Axiaal" image, a News Detail template is shown.

Backend:
In the content textarea of this news article I did insert a cms_selflink.

Frontend:
The result of this cms_selflink is

Code: Select all

<a class="button" href="{cms_selflink href='offerte-ventilatoren'}">Offerte aanvragen</a>
When clicking on it the url is http://www.vencontra.com/%7Bcms_selflin ... atoren'%7D

My question
What seems to be the problem that the cms_selflink is not working in the News article content?

Any iedeas?

CMSMS
- CMS 2.2.9.1
- News 2.51.4

Extra modules:
- CGBetterForms 1.9.1
- CGExtensions 1.61.5
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1800
Joined: Wed Feb 25, 2009 4:25 am

Re: News with cms_selflink not working

Post by DIGI3 »

If you look at the comments in the sample News templates, you'll see it says that News Detail isn't parsed through Smarty for security reasons. If you are comfortable with the risks (ie, you're not allowing front end submissions), you can use {eval} to parse it, then Smarty tags like cms_selflink will work.
Not getting the answer you need? CMSMS support options
rooon
Forum Members
Forum Members
Posts: 113
Joined: Mon Dec 05, 2011 4:40 pm

Re: News with cms_selflink not working

Post by rooon »

Hi Digi3,

Thanx for your answer.
A frontend submission form is not used.

In the News Detail template I tried

Code: Select all

{eval var=$entry->content assign="newsContent"}
{$newsContent}

and

{eval var=$entry->content}
Both without success. Also after clearing /tmp/ subfolders no success.
Please give some more hints where to use the {eval}

** this is my Details template

Code: Select all

{strip}
{if isset($entry->canonical)}
  {assign var='canonical' value=$entry->canonical scope=global}
{/if}
{* global var 'newsDetails' for page template *}
{assign var='newsDetails' value=$entry scope=global}
{/strip}
<div id="detailContent">
  {eval var=$entry->content}
</div>
Thanx in advance.
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1800
Joined: Wed Feb 25, 2009 4:25 am

Re: News with cms_selflink not working

Post by DIGI3 »

{eval var=$entry->content} worked fine for me. Perhaps you're not editing the correct template? (different design, or detail vs summary)
Not getting the answer you need? CMSMS support options
rooon
Forum Members
Forum Members
Posts: 113
Joined: Mon Dec 05, 2011 4:40 pm

[SOLVED] News with cms_selflink not working

Post by rooon »

For some reason it does work now with

Code: Select all

{eval var=$entry->content}
Thanx again for your hint.
Locked

Return to “CMSMS Core”