Problem with Module News

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
krisek
New Member
New Member
Posts: 4
Joined: Tue May 31, 2016 5:50 pm

Problem with Module News

Post by krisek »

hello
CMS ver 1.9.1
News 2.11

On the home page is a place with that display the news . The trouble is , and I want to get one from the list display is always on the top.

I need to pull "$ items.index," how can I do?

how can I bring news_id using the smarty template

Code: Select all

{foreach from=$items item=entry ???????}
chandra

Re: Problem with Module News

Post by chandra »

Not sure what you want ...

You got index with

Code: Select all

{foreach from=$items item=entry name='topnews'}
and

Code: Select all

{$smarty.foreach.topnews.index}


variable inside the loop

http://www.smarty.net/docsv2/en/languag ... oreach.tpl

News ID sould be available with

Code: Select all

{$entry->id}
inside the loop.
User avatar
Jo Morg
Dev Team Member
Dev Team Member
Posts: 1973
Joined: Mon Jan 29, 2007 4:47 pm

Re: Problem with Module News

Post by Jo Morg »

Please use always the latest documentation for smarty. In this case:
http://www.smarty.net/docs/en/language. ... oreach.tpl
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
chandra

Re: Problem with Module News

Post by chandra »

My posted link is correct ;)
krisek wrote: CMS ver 1.9.1
means Smarty2.

There are some differences to Smarty3 which could confuse the questioner.
User avatar
Jo Morg
Dev Team Member
Dev Team Member
Posts: 1973
Joined: Mon Jan 29, 2007 4:47 pm

Re: Problem with Module News

Post by Jo Morg »

Yeah, I totally missed the CMSMS version.

@krisek: Please upgrade as soon as possible, at least to CMSMS 1.12.2, but recommended to 2.1.4. Mainly for security and stability reasons.
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
krisek
New Member
New Member
Posts: 4
Joined: Tue May 31, 2016 5:50 pm

Re: Problem with Module News

Post by krisek »

THX !!

{foreach from=$items item=entry }

{if $entry->id=="175"}
<div class="NewsSummary">
(...)
</div>
{/if}
{/foreach}

It works !! :)
Post Reply

Return to “Modules/Add-Ons”