Page 1 of 1
Content block in News iteration
Posted: Mon Jul 01, 2019 1:46 pm
by AccentAvondschool
Hi,
if I call the {$entry->} vars (see below) via a content block, I only get to see the latest newsitem several times. This has worked in CMSMS v1 and probably has to do with the scope in v2? Does anyone have an idea?
Works ...
Code: Select all
{foreach from=$items item=entry}
<div class="col-md-3 col-sm-6 col-xs-12">
{$entry->title}
{$entry->summary}
{$entry->content}
</div>
{/foreach}
Doesn't work ...
Code: Select all
{foreach from=$items item=entry}
<div class="col-md-3 col-sm-6 col-xs-12">
{global_content name='newsitem'}
</div>
{/foreach}
Thanks in advance
Re: Content block in News iteration
Posted: Mon Jul 01, 2019 2:35 pm
by calguy1000
Please post system info when requesting assistance. It helps us to help you.
Re: Content block in News iteration
Posted: Wed Jul 03, 2019 12:21 pm
by AccentAvondschool
I'm sorry, I forgot to include the system info.
i just thought, the content block is an import from v1 and has the type 'Core: generic'. Perhaps I should put this block on 'News: Detail'?
- Cms Version: 2.2.10
Installed Modules:
AdminSearch: 1.0.4
CGBlog: 1.15.10
CGCalendar: 2.6
CGContentUtils: 2.3
CGExtensions: 1.63.2
CGHTML2PDF: 1.0.3
CGJobMgr: 1.3.6
CGSimpleSmarty: 2.2.1
CGSmartImage: 1.22.7
CGSnapshot: 1.4
CGSocialBlaster: 1.1
CGUserDirectory: 1.5.1
CMSContentManager: 1.1.7
CMSMailer: 6.2.14
CmsJobManager: 0.1.3
DesignManager: 1.1.6
ECB2: 1.5.3
FAQ: 2.0.3
FEU_PMs: 1.0.0
FEupload: 0.3.1
FileManager: 1.6.8
FilePicker: 1.0.4
FormBuilder: 0.8.1.6
FrontEndUsers: 2.14.3.1
Gallery: 2.3.2
JQueryTools: 1.4.2
ListIt2: 1.4.1
ListIt2ListIt2Original: 1.4.1
ListIt2ListIt2team: 1.4.1
ListIt2XDefs: 1.2
ListIt2team: 1.4.1
MenuManager: 1.50.3
MicroTiny: 2.2.4
ModuleManager: 2.1.6
NMS: 2.13.3
Navigator: 1.0.9
News: 2.51.6
Search: 1.51.6
ThemeManager: 1.1.8
Php Information:
phpversion: 7.0.33-0+deb9u3
Re: Content block in News iteration
Posted: Fri Jul 05, 2019 11:43 am
by AccentAvondschool
Setting the content block / template from 'Core: generic' to 'News: Detail' does the trick. Sorry I didn't test that first.
But this only works when I'm logged in into Admin (on another tab in browser). After loging out I only get to see the latest or first news-item several times.
Re: Content block in News iteration
Posted: Fri Jul 05, 2019 9:53 pm
by velden
Maybe related:
Site Admin > Settings - Global Settings > Smarty Settings > Enable Smarty Caching
When enabled, the output from various plugins will be cached to increase performance. Additionally, most portions of compiled templates will be cached. This only applies to output on content pages marked as cachable, and only for non-Admin users. Note, this functionality may interfere with the behaviour of some modules or plugins, or plugins that use non-inline forms.
Note: When smarty caching is enabled, global content blocks (GCBs) are always cached by smarty, and user defined tags (UDTs) are never cached. Additionally, content blocks are never cached.
Re: Content block in News iteration
Posted: Sat Jul 06, 2019 8:40 am
by AccentAvondschool
Thx velden,
Smarty Caching is/was always enabled.
The update from 1 to 2 gives me more and more the presumption that I am using somewhere an outdated or a deprecated smarty code (in an UDT).
The errorlog does not indicate anything and the debug option gives so much information that it doesn't really make me wiser.
Does anyone know if there is still a way to uncover any outdated/deprecated smarty code as an error?
Re: Content block in News iteration
Posted: Sat Jul 06, 2019 2:24 pm
by calguy1000
Make sure that smarty caching is disabled.
It caches HTML, not templates.
Re: Content block in News iteration
Posted: Mon Jul 08, 2019 8:08 am
by AccentAvondschool
Thx calguy (again),
In addition to an adjustment to the following, which solved another problem ...
Code: Select all
{share_data scope=parent vars='***'}
... to ...
Code: Select all
{share_data scope=global vars='***'}
... disabling the smarty cache really really did the job for us!
Finally the news-items overviews works again
