Page 1 of 2

News 2.0 & cms_selflink

Posted: Wed Nov 16, 2005 7:11 am
by pinthenet
The cms_selflink tag doesn't seem to get recognised in a News summary (or detail?). I thought this used to work (but can't prove it). Do tags work at all in News content?
Is there an alternative solution other than inserting a normal link with the editor - the cms_selflink is a simple solution for general users.

Thanks

Re: News 2.0 & cms_selflink

Posted: Thu Nov 17, 2005 1:01 am
by Ted
It probably does not work properly in 0.10.x.  It SHOULD work in the 0.11 betas, but I haven't confirmed that.

Re: News 2.0 & cms_selflink

Posted: Thu Nov 17, 2005 11:21 am
by pinthenet
Still get the same result in 11beta4....

I also notice that in 10 & 11 I  have to hit submit twice when editing a news (or event) item - the first time it just redisplays the edit page

Re: News 2.0 & cms_selflink (& Calendar)

Posted: Thu Nov 17, 2005 11:57 am
by pinthenet
Just found the same problem in the Calendar 0.7alpha2 module

Re: News 2.0 & cms_selflink

Posted: Thu Nov 17, 2005 12:37 pm
by pinthenet
Double Submit problem resolved - thanks Patricia

Re: News 2.0 & cms_selflink

Posted: Fri Nov 18, 2005 11:27 am
by pinthenet
But I can't get plugins to work in News (& events & calendar) with 0.11beta5. I've tried on 2 test sites now and I've also copied the tag I use to a normal page and it works.

Am I doing something wrong?

Re: News 2.0 & cms_selflink

Posted: Mon Dec 19, 2005 7:35 pm
by pinthenet
Well, it's a month later and I'm on to 0.11.1 and I still can't use plugins or modules from News (or Events).

Does anyone have a tip?

John

Re: News 2.0 & cms_selflink

Posted: Mon Dec 19, 2005 8:32 pm
by westis
Hi pinthenet,

You should be able to use tags if you put eval in the template tags for summary and content, like this:

Code: Select all

{eval var=$entry->summary} 
{eval var=$entry->content} 

Re: News 2.0 & cms_selflink

Posted: Tue Dec 20, 2005 7:17 am
by pinthenet
I'll try but I get the impression that the tags are not even recognized - eg {cms_selflink page='page'} appears in the final page - it's not as though I'm getting partial output and no variables
John

Re: News 2.0 & cms_selflink

Posted: Wed Dec 21, 2005 7:28 am
by pinthenet
Still no luck I'm afraid... eg I put {cms_selflink page='1'} (or any other cmsms directive) in the News detail or summary and in the generated page I get {cms_selflink page='1'}. If I copy/past to a 'normal' page all works fine.

I've checked the html - no extra quotes etc

In fact it doesn't matter what I try (eg {the story of my life}), the curly brackets are treated as normal page content.

I can get round it for cms_selflink by creating a normal href (not so good for less experienced users), or by using FCKeditorX's special functions, but I also need to be able to include modules - eg a gallery. At the moment I have to create an intermediate page to do this.
Could it be that a module cannot call/include other modules?

I assume others have been able to do this successfully....?

Help?

John

Re: News 2.0 & cms_selflink

Posted: Wed Dec 21, 2005 8:03 pm
by pinthenet
This is becoming a one-sided discussion I'm afraid, but when I read the 0.11.2 changelog:

* Fixed bug with News module to allow tags in the content to be parsed properly by smarty

I thought my problem was solved

Unfortunately it wasn't.....

Anyone?

John

Re: News 2.0 & cms_selflink

Posted: Wed Dec 21, 2005 8:11 pm
by petert
pinthenet wrote: This is becoming a one-sided discussion I'm afraid, but when I read the 0.11.2 changelog:
* Fixed bug with News module to allow tags in the content to be parsed properly by smarty
I thought my problem was solved
Same here, no tags are parsed in the news-content.
I also get replies that it all is fixed. I run the latest svn version and it just doesn't work.
The svn version I am using now is so bad it won't display pages (I reported that already as a bug).
Let's hope that the proper 0.11.2 release http://forum.cmsmadesimple.org/index.ph ... l#msg13917 works

Re: News 2.0 & cms_selflink

Posted: Wed Dec 21, 2005 8:25 pm
by westis
In 0.11.2 this works just fine for me, after a fresh install. If you upgrade to 0.11.2 from 0.11.1 it should work if you just add {eval var= in the summary and content tags in the news templates, as I wrote above.

If not, try pasting these full templates as Summary Template and Detail Template respectively.

Summary Template:

Code: Select all

<!-- Start News Display Template -->
{foreach from=$items item=entry}

<div class="NewsSummaryLink">
	{$entry->titlelink}
</div>

<div class="NewsSummaryCategory">
	{$entry->category}
</div>

{if $entry->formatpostdate}
	<div class="NewsSummaryPostdate">
		{$entry->formatpostdate}
	</div>
{/if}

{if $entry->summary}
	<div class="NewsSummarySummary">
		{eval var=$entry->summary}
	</div>

	<div class="NewsSummaryMorelink">
		[{$entry->morelink}]
	</div>

{else if $entry->content}

	<div class="NewsSummaryContent">
		{eval var=$entry->content}
	</div>
{/if}

{/foreach}
<!-- End News Display Template -->

Detail Template:

Code: Select all

<h3 id="NewsPostDetailTitle">{$entry->title}</h3>

<hr id="NewsPostDetailHorizRule">

{if $entry->category}
	<div id="NewsPostDetailCategory">
		{$entry->category}
	</div>
{/if}

{if $entry->postdate}
	<div id="NewsPostDetailDate">
		Posted: {$entry->postdate|date_format}
	</div>
{/if}

{if $entry->summary}
	<div id="NewsPostDetailSummary">
		<strong>
			{eval var=$entry->summary}
		</strong>
	</div>
{/if}

<div id="NewsPostDetailContent">
	{eval var=$entry->content}
</div>

<div>
	{$entry->printlink}
</div>

Re: News 2.0 & cms_selflink

Posted: Thu Dec 22, 2005 8:25 am
by petert
westis wrote: In 0.11.2 this works just fine for me, after a fresh install. If you upgrade to 0.11.2 from 0.11.1 it should work if you just add {eval var= in the summary and content tags in the news templates, as I wrote above.
Hmmm, that doesn't sound like it is fixed. Sounds more like a hack.
westis wrote: If not, try pasting these full templates as Summary Template and Detail Template respectively.

I copied both those templates in my svn version 2385 and still no luck. The page gets parsed up until the {eval statement, processing of the page is stopped after that...

Re: News 2.0 & cms_selflink

Posted: Thu Dec 22, 2005 9:23 am
by pinthenet
OK partial success! I realised I was misunderstanding the sequence so tried the eval trick again and it works in 11.1 & 11.2, but it still doesn't work with 11.2 without the eval.

Question - if I do a fresh install will CMSMS recognise an existing DB? Otherwise I assume I have to recreate everything.

John