Content block in News iteration

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Locked
User avatar
AccentAvondschool
Forum Members
Forum Members
Posts: 41
Joined: Sun May 08, 2016 5:36 am
Location: Rotterdam NL

Content block in News iteration

Post 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
Regards,

Accent Avondonderwijs
René
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Content block in News iteration

Post by calguy1000 »

Please post system info when requesting assistance. It helps us to help you.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
User avatar
AccentAvondschool
Forum Members
Forum Members
Posts: 41
Joined: Sun May 08, 2016 5:36 am
Location: Rotterdam NL

Re: Content block in News iteration

Post 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
Regards,

Accent Avondonderwijs
René
User avatar
AccentAvondschool
Forum Members
Forum Members
Posts: 41
Joined: Sun May 08, 2016 5:36 am
Location: Rotterdam NL

Re: Content block in News iteration

Post 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.
Regards,

Accent Avondonderwijs
René
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3483
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: Content block in News iteration

Post 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.
User avatar
AccentAvondschool
Forum Members
Forum Members
Posts: 41
Joined: Sun May 08, 2016 5:36 am
Location: Rotterdam NL

Re: Content block in News iteration

Post 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?
Regards,

Accent Avondonderwijs
René
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Content block in News iteration

Post by calguy1000 »

Make sure that smarty caching is disabled.
It caches HTML, not templates.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
User avatar
AccentAvondschool
Forum Members
Forum Members
Posts: 41
Joined: Sun May 08, 2016 5:36 am
Location: Rotterdam NL

Re: Content block in News iteration

Post 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 ;)
Regards,

Accent Avondonderwijs
René
Locked

Return to “Modules/Add-Ons”