Page 1 of 1

Using {news} tag in NMS 2.12.2: Fatal error

Posted: Fri Dec 30, 2016 5:21 pm
by map_1961
Hi.
1. In the former cmsms versions (1.11.13) i managed to use the {news} module call with additional options in the NMS content area. This caused a significant lower effort creating newsletters with the current page news: just send it!

2. Now we use a cmsms 2.1.6 install and the latest NMS version 2.12.2. When i try to send out a newsletter including the {News} module call - like we are used to do - i get this error message:
"Fatal error: Uncaught --> Smarty Compiler: Syntax error in template "nms_content:content" on line 27 "{News category="general"}" unknown tag "News" <-- thrown in /homepages/path_of_the_installation/lib/smarty/sysplugins/smarty_internal_templatecompilerbase.php on line 27"

3. Who can give a hint how 2 get the {News} module call get working again with the current NMS version?

Thanks

MAP

Re: Using {news} tag in NMS 2.12.2: Fatal error

Posted: Fri Dec 30, 2016 6:08 pm
by Rolf
{news} lowercase

Re: Using {news} tag in NMS 2.12.2: Fatal error

Posted: Fri Dec 30, 2016 8:37 pm
by map_1961
Thx Rolf.

But this seems not to be the solution.
It gives me once more:
Fatal error: Uncaught --> Smarty Compiler: Syntax error in template "nms_content:content" on line 1 "<div> {news} </div>" unknown tag "news" <-- thrown in /homepages/path_of_the_page/lib/smarty/sysplugins/smarty_internal_templatecompilerbase.php on line 1

Maybe it's because the cmsms 2.x handles the smarty tags in another way???

Thx

MAP

Re: Using {news} tag in NMS 2.12.2: Fatal error

Posted: Fri Dec 30, 2016 9:18 pm
by Rolf
{cms_module module='news'}

Re: Using {news} tag in NMS 2.12.2: Fatal error

Posted: Sat Dec 31, 2016 9:38 am
by map_1961
Thx Rolf.
Now the fatal error is gone but the newsletter result is empty.

Thx again MAP

Re: Using {news} tag in NMS 2.12.2: Fatal error

Posted: Sat Dec 31, 2016 1:42 pm
by Rinker
Maybe you can try to 'capture' the news first.

Code: Select all

/* Get the news */
{capture name='mynews_content' assign='news_content'}
{cms_module module='news'}
{/capture}

/* Display the news */
{$news_content}

Re: Using {news} tag in NMS 2.12.2: Fatal error

Posted: Mon Jan 02, 2017 10:13 am
by map_1961
Thank you Rinker.

I copied the code proposed to the newsletter content area and tried it.

The result is a newsletter including this text:
"/* Get the news */
/* Display the news */ "

???

Thank you once more

MAP

[solved] Using {news} tag in NMS 2.12.2: Fatal error

Posted: Mon Jan 02, 2017 2:30 pm
by map_1961
Hi guys,

i don't know why but i now got it now working using this code:
{cms_module module='News'}

..plus additional params.

Upper case seems to be mandatory.

Thx x 1000


Your

MAP

Re: Using {news} tag in NMS 2.12.2: Fatal error

Posted: Mon Jan 02, 2017 3:43 pm
by map_1961
...Upps: now another problem occures:

The link url of the news posted in the newsletter is missing a part:

News in the browser has this url:
http://domain/news/30[b]/52/[/b]news-title/

The link url posted in the newsletter is missing the
http://domain/news/30[b]//[/b]news-title/

The middle part - 52 - is missing. Of course i can give any news a custom url, but this would be an additional process that i'd like to prevent.
This is the news summary template:

Code: Select all

<!--Creative Bootstrap News summary -->
{foreach from=$items item=entry name=entry}
{if ($smarty.foreach.entry.index % 2) == 0}
<div class="row">
{assign var=closed value=false} 
{/if}	
<div class="col-md-6 col-sm-6 news-teaser">
    <div class="caption">
<h3><a href="{$entry->moreurl}">{$entry->title|cms_escape:htmlall}</a></h3>
<div class="thumbnail">
        {if isset($entry->fields)}
        {foreach from=$entry->fields item='field'}
        {if $field->type == 'file' && $field->value != ""}
        <a href="{$entry->moreurl}"><img class="img-responsive" src="{CGSmartImage src1=$entry->file_location src2=$field->value alias1='medium' notag=1 filter_watermark=1}" alt="{$entry->title|cms_escape}"></a>
        {/if}
        {/foreach}
        {/if}
<div class="caption">
         
<div class="text-muted"><small>{if $entry->postdate}<span><i class="fa fa-calendar"></i> {$entry->postdate|cms_date_format}</span>{/if}{if $entry->category} | <span><i class="fa fa-tag"></i>  {$entry->category}</span>{/if}{if $entry->author} | <span><i class="fa fa-user"></i> {$entry->author}</span>{/if}</small></div>
          {if $entry->summary}
          {eval var=$entry->summary}
          {else if $entry->content}
          {eval var=$entry->content}
          {/if}
          <p><a href="{$entry->moreurl}" class="btn btn-default btn-xs">MEHR DAZU...</a></p>
        </div>
        <div style="border-top: 1px dotted #5b6d31;"> </div>
</div>
</div>
{if ($smarty.foreach.entry.iteration % 2) == 0}
</div>
{assign var=closed value=true}
{/if}
  {/foreach}
{if $closed == false}</div>{/if}
<!-- /.news summary -->
So its going ahead step by step!

Thx

MAP

Re: Using {news} tag in NMS 2.12.2: Fatal error

Posted: Mon Jan 02, 2017 3:45 pm
by Rolf
set default summary/detail page in News settings

[solved] Using {news} tag in NMS 2.12.2: Fatal error

Posted: Mon Jan 02, 2017 5:08 pm
by map_1961
Super Rolf. This is it.
You made an old man happy!!

Yours

MAP

Re: Using {news} tag in NMS 2.12.2: Fatal error

Posted: Mon Jan 02, 2017 5:21 pm
by map_1961
i'd like to add the [solved] to the subject field but don't find an edit button any more..???

MAP