Hiding headlines which has summary already??
Hiding headlines which has summary already??
Hello!!
I have problem in news modules, hope picture will make more clear.
Thank you in advance.
I have problem in news modules, hope picture will make more clear.
Thank you in advance.
- Attachments
-
- cms-prob.jpg (37.8 KiB) Viewed 3658 times
Re: Hiding headlines which has summary already??
I desperately need to know this please help me out!!! 

Re: Hiding headlines which has summary already??
We need more info before we can even try to help... 
How To Submit a Question So You'll Actually Get Help
Where in your templates you call the news tag and how? What's your news template like?.... etc, etc, etc...

How To Submit a Question So You'll Actually Get Help
Where in your templates you call the news tag and how? What's your news template like?.... etc, etc, etc...
"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!
* 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!
Re: Hiding headlines which has summary already??
I guess you call the {news} from your detail template to show the summary below the detail view?
If so:
Assign de news id to a variable somewhere in the detail template:
Check for that variable in your summarytemplate:
If so:
Assign de news id to a variable somewhere in the detail template:
Code: Select all
{assign var='currentNewsItem' value=$entry->id}
Code: Select all
{foreach from=$items item=entry}
{if !isset($currentNewsItem) || $currentNewsItem != $entry->id}
//YOUR NORMAL CODE
{/if}
{/foreach}
Re: Hiding headlines which has summary already??
Thank you jo! for the reply and sorry for not detail info!!Jo Morg wrote:We need more info before we can even try to help...
How To Submit a Question So You'll Actually Get Help
Where in your templates you call the news tag and how? What's your news template like?.... etc, etc, etc...
I am using CMS Made Simple v. 1.11.4 and i want to use it it my news summary template, my current news summary template is like this:
<!-- Start News Display Template -->
{* This section shows a clickable list of your News categories. *}
{* this displays the category name if you're browsing by category *}
{if $category_name}
{/if}
{* if you don't want category browsing on your summary page, remove this line and everything above it *}
{foreach from=$items item=entry}
<div class="articles">
<a href="{$entry->moreurl}" title="{$entry->title|cms_escape:htmlall}">{$entry->title|cms_escape}</a>
{if $entry->summary}
<div class="NewsSummarySummary">
{eval var=$entry->summary|truncate:335}
</div>
<div class="morelink">
{$entry->morelink}
</div>
{else if $entry->content}
<div class="NewsSummaryContent">
{eval var=$entry->content}
</div>
{/if}
{if isset($entry->extra)}
<div class="NewsSummaryExtra">
{eval var=$entry->extra}
{* {cms_module module='Uploads' mode='simpleurl' upload_id=$entry->extravalue} *}
</div>
{/if}
</div>
{/foreach}
<!-- End News Display Template -->
and to call news with summary in page this way:
{news summarytemplate="sports" pagelimit=1 category="politics" moretext="read more >>" detailpage="news"}
and to call headlines i am using this template:
<ul>
{foreach from=$items item=entry}
<li><a href='{$entry->moreurl}'
title='{$entry->title|cms_escape:htmlall}'>{$entry->title|cms_escape}</a>
</li>
{/foreach}
</ul>
Thank you.
Re: Hiding headlines which has summary already??
Thank you velden for reply, still no luck.velden wrote:I guess you call the {news} from your detail template to show the summary below the detail view?
If so:
Assign de news id to a variable somewhere in the detail template:Check for that variable in your summarytemplate:Code: Select all
{assign var='currentNewsItem' value=$entry->id}
Code: Select all
{foreach from=$items item=entry} {if !isset($currentNewsItem) || $currentNewsItem != $entry->id} //YOUR NORMAL CODE {/if} {/foreach}
Re: Hiding headlines which has summary already??
I don't understand your goal exactly:
Your calling a summary template to display some items and after that you call the code to display headlines (which I would expect to be called from a summarytemplate).
Your calling a summary template to display some items and after that you call the code to display headlines (which I would expect to be called from a summarytemplate).
Re: Hiding headlines which has summary already??
yeah, valden, i have 2 summary templates, one for headlines with news description and other for headlines only (as in attach image), now headline (with description ) also come in headlines, its not looking good coz it get repeat so i want to hide it from headlines.velden wrote:I don't understand your goal exactly:
Your calling a summary template to display some items and after that you call the code to display headlines (which I would expect to be called from a summarytemplate).
Hope you get it now. Thank you.
Re: Hiding headlines which has summary already??
Ok, almost clear.
Apparently you have found a method to distinct between news items that have a news description and items that have not.
I would use the reverse method to find the headline only items.
Further, it might me a little more efficient to combine those in one template/foreach-loop. By capturing and appending the headline-output in a variable and output that at the end. So you can first display the 'news-with-description' and after that the headlines.
Apparently you have found a method to distinct between news items that have a news description and items that have not.
I would use the reverse method to find the headline only items.
Further, it might me a little more efficient to combine those in one template/foreach-loop. By capturing and appending the headline-output in a variable and output that at the end. So you can first display the 'news-with-description' and after that the headlines.
Re: Hiding headlines which has summary already??
Ok, if I get it correctly you need to make two distinct lists:
You can also try velden suggestion, but avoid capturing content whenever possible as it is too slow compared to simple assigning tags into variables.
- All the articles that have summary;
- All those that don't have summary;
Code: Select all
<ul>
{foreach from=$items item=entry}
{if !$entry->summary}
<li>
<a href='{$entry->moreurl}'
title='{$entry->title|cms_escape:htmlall}'>{$entry->title|cms_escape}</a>
</li>
{/if}
{/foreach}
</ul>
"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!
* 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!
Re: Hiding headlines which has summary already??
Thank you Jo for reply.You mean i should change in headlines template? I changed it but in page headlines disappeared, i am not good in programming as i am designer. So i need more detail.Jo Morg wrote:Ok, if I get it correctly you need to make two distinct lists:So, if that is the case, in your headlines template you would do something like
- All the articles that have summary;
- All those that don't have summary;
You can also try velden suggestion, but avoid capturing content whenever possible as it is too slow compared to simple assigning tags into variables.Code: Select all
<ul> {foreach from=$items item=entry} {if !$entry->summary} <li> <a href='{$entry->moreurl}' title='{$entry->title|cms_escape:htmlall}'>{$entry->title|cms_escape}</a> </li> {/if} {/foreach} </ul>
Thank you in advance.