News Module Detail page issue

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
jasnick
Power Poster
Power Poster
Posts: 695
Joined: Sat Jan 15, 2011 8:36 am

News Module Detail page issue

Post 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
Last edited by jasnick on Thu Feb 21, 2013 7:35 am, edited 3 times in total.
Wishbone
Power Poster
Power Poster
Posts: 1368
Joined: Tue Dec 23, 2008 8:39 pm

Re: News Module Detail page issue

Post by Wishbone »

Can you show us an example?
jasnick
Power Poster
Power Poster
Posts: 695
Joined: Sat Jan 15, 2011 8:36 am

Re: News Module Detail page issue

Post by jasnick »

Just realised I had left off the link!
Wishbone
Power Poster
Power Poster
Posts: 1368
Joined: Tue Dec 23, 2008 8:39 pm

Re: News Module Detail page issue

Post by Wishbone »

Hmm.. I'm not seeing the 'more' links you are referring to.
jasnick
Power Poster
Power Poster
Posts: 695
Joined: Sat Jan 15, 2011 8:36 am

Re: News Module Detail page issue

Post by jasnick »

That's because there aren't any - the site is live. Sorry!

OK - I've added one so you can see

Thanks!
Wishbone
Power Poster
Power Poster
Posts: 1368
Joined: Tue Dec 23, 2008 8:39 pm

Re: News Module Detail page issue

Post by Wishbone »

That's interesting.. Can you post your summary template?
jasnick
Power Poster
Power Poster
Posts: 695
Joined: Sat Jan 15, 2011 8:36 am

Re: News Module Detail page issue

Post 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}&nbsp;{$prevpage}&nbsp;
{/if}
{$pagetext}&nbsp;{$pagenumber}&nbsp;{$oftext}&nbsp;{$pagecount}
{if $pagenumber < $pagecount}
&nbsp;{$nextpage}&nbsp;{$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}:&nbsp;{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.
jasnick
Power Poster
Power Poster
Posts: 695
Joined: Sat Jan 15, 2011 8:36 am

Re: News Module Detail page issue

Post 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.
Post Reply

Return to “CMSMS Core”