Page 1 of 1
News Module Detail page issue
Posted: Wed Apr 06, 2011 4:18 am
by jasnick
Using CMSMS latest version - Have set up the News Module as I need it by changing the Summary template. I need only title of item, date pasted and item itself. No categories etc.
I found that associating the Module: News stylesheet with the site template did not work so I pasted the relevant bits of code into my main stylelsheet.
I found that the title became a link which was not needed so I changed that. It's fine for short items.
However, if there is a large item that produces a "more" link, the resulting page is not very well laid out and moreover, the entire list of items is shown. I have the News module in a box, and the entire box is shown under the "more" item.
Which template do I need to modify and how do I do that? Is it the Detail template?
Site is [deleted]
Thanks
Re: News Module Detail page issue
Posted: Wed Apr 06, 2011 4:20 am
by Wishbone
Can you show us an example?
Re: News Module Detail page issue
Posted: Wed Apr 06, 2011 4:21 am
by jasnick
Just realised I had left off the link!
Re: News Module Detail page issue
Posted: Wed Apr 06, 2011 4:23 am
by Wishbone
Hmm.. I'm not seeing the 'more' links you are referring to.
Re: News Module Detail page issue
Posted: Wed Apr 06, 2011 4:44 am
by jasnick
That's because there aren't any - the site is live. Sorry!
OK - I've added one so you can see
Thanks!
Re: News Module Detail page issue
Posted: Wed Apr 06, 2011 5:45 am
by Wishbone
That's interesting.. Can you post your summary template?
Re: News Module Detail page issue
Posted: Wed Apr 06, 2011 5:56 am
by jasnick
This is the one I made to take out all the stuff I didn't want. Works fine for the list on the main page.
<!-- Start News Display Template -->
{if $pagecount > 1}
<p>
{if $pagenumber > 1}
{$firstpage} {$prevpage}
{/if}
{$pagetext} {$pagenumber} {$oftext} {$pagecount}
{if $pagenumber < $pagecount}
{$nextpage} {$lastpage}
{/if}
</p>
{/if}
{foreach from=$items item=entry}
<div class="NewsSummary">
<div class="NewsSummaryLink">
{$entry->title|cms_escape:htmlall}
</div>
{if $entry->postdate}
<div class="NewsSummaryPostdate">
{$entry->postdate|cms_date_format}
</div>
{/if}
{if $entry->summary}
<div class="NewsSummarySummary">
{eval var=$entry->summary}
</div>
<div class="NewsSummaryMorelink">
[{$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}
{if isset($entry->fields)}
{foreach from=$entry->fields item='field'}
<div class="NewsSummaryField">
{if $field->type == 'file'}
<img src="{$entry->file_location}/{$field->value}"/>
{else}
{$field->name}: {eval var=$field->value}
{/if}
</div>
{/foreach}
{/if}
</div>
{/foreach}
<!-- End News Display Template -->
I'm currently looking at editing the CSS for #NewsPostDetailDate etc and just adding it to my normal stylesheet. Its getting rid of the entire #sidebar box that contains the News that is the issue.
When I look at Page Source on the detail page, the "detail" bit is in #main (as it should be) and then #sidebar appears in the source.
[updated] Have done a new stylesheet and added the style changes. Now need to get rid of #sidebar from the detail page.
Re: News Module Detail page issue
Posted: Wed Apr 06, 2011 7:42 am
by jasnick
I think this is what I need:
From the {news} help:
(optional) detailpage="pagealias" - Page to display News details in. This can either be a page alias or an id. Used to allow details to be displayed in a different template from the summary.
So I added a new page - page alias is "news-items".
In the main site template I added:
{if $page_alias=='news-items'}
{stylesheet name="Avalon Sails"}
{/if} and in the Home page I added:
{news detailpage="news-items"}
Not sure if that is the correct syntax.
However, if I click on 'return' it returns to a blank page instead of the Home page.
Edited: I have posted this issue separately as I have now got eveything set up OK except for the return link not working correctly.