Page 1 of 1
News layout
Posted: Thu Nov 24, 2005 12:02 am
by mrHref
I'm quite new with CMS Made Simple and PHP but I've already managed to set up the site and with help of arcticles of this forum I've managed to get International settings to work in News module. Now I wonder how the layout (article list on right side and articles opening to center) is done in
http://svntest.cmsmadesimple.org/index.php?page=Modules
I would be apreciate a lot if somebody could send a sample code/template to this forum.
with greetings mf Href
Re: News layout
Posted: Thu Nov 24, 2005 7:04 am
by westis
Hi Href,
You'll have to add some classes to the News Summary template (Content -> News -> Summary Template tab) and style those classes in a stylesheet that is attached to the template for that page.
In previous versions of the News module there were no default classes in the Summary template, but it will be with the 0.11 release. If you check the Detail Template the Smarty tags are wrapped in div's with id's. Similarly you can wrap each part of the news article in the Summary Template in a div and give it a class or id name.
Like this:
Code: Select all
<div class="NewsSummaryCategory">
({$entry->category})
</div
{if $entry->formatpostdate}
<div class="NewsSummaryPostdate">
{$entry->formatpostdate}
</div
{/if}
Then add a stylesheet (Layout -> Stylesheets -> Add Stylesheet) that you can call News, for example, or add these classes to an existing stylesheet. Make sure this stylesheet is attached to the template that the page with the news article list is using.
In that stylesheet, style the text any way you want. On the link you refer to (which will be the default installation with 0.11), the classes used for the news summry template are styled as follows:
Code: Select all
.NewsSummaryCategory {
font-style: italic;
margin: 5px 0;
}
.NewsSummaryPostdate {
font-size: 90%;
font-weight: bold;
}
.NewsSummarySummary, .NewsSummaryContent {
line-height: 140%;
margin-bottom: 10px;
}
Hope I've made myself clear. I'm still half asleep early in the morning...
Re: News layout
Posted: Thu Nov 24, 2005 11:15 am
by petert
westis wrote:
In previous versions of the News module there were no default classes in the Summary template, but it will be with the 0.11 release.
Wow, this is a great enhancement. Great stuff
westis wrote:
Hope I've made myself clear. I'm still half asleep early in the morning...
I understood it, so everybody else will I guess
Re: News layout
Posted: Tue Dec 20, 2005 9:22 pm
by mrHref
Yes I can change the style of layout but ... I still can't get summary list and article to the same page like in sample page
http://svntest.cmsmadesimple.org/index.php?page=Modules
How do I have to combine summary template & detail template in order to do that ? I would like to have an news page with latest arcticle in the left and article list on the right.
Thanks in advance
mrHref
Re: News layout
Posted: Tue Dec 20, 2005 9:32 pm
by westis
Hi mrHref,
You'll have to do that in your page template, with the {content} in the left column and the news tag in the right column.
That part of the template (one of the default templates in 0.11.x) looks like this:
Code: Select all
<div id="main">
{content}
</div>
<div id="content2">
<h2>News</h2>
{cms_module module='news' number='5' category='general'}
</div>
Then set the width of each of those two columns in the stylesheet, something like this:
Code: Select all
div#main {
float: right;
width: 340px;
display: inline;
margin-right: 210px;
margin-left: -220px;
}
div#menu_vert {
float: left;
width: 200px;
display: inline;
}
div#content2 {
float: right;
width: 200px;
display: inline;
margin-right: -340px;
margin-left: 200px;
}
Hope that helps.

Re: News layout
Posted: Tue Dec 20, 2005 11:21 pm
by mrHref
Thanks a lot. Now I get it right. I stuck to those templates in Content > News and I didn't realize that I can place news module straight to page template and that then it automatically loads messages to {content} section of the page.
Once more thanks a lot

mrHref
Re: News layout
Posted: Wed Dec 21, 2005 10:38 pm
by mrHref
Hello again,
I'm having one more question. Is it possible get latest news article to {content} area when you open news page from menu. If it is possible how it is done (I'm not very good with php).
I've done my news page following your advices and when I select news from my menu I get page with blank {content} area and article list on the right.
Merry Christmas & Happy New Year to everyone
mfHref
Re: News layout
Posted: Wed Dec 21, 2005 10:49 pm
by westis
In the page (Content->Pages-> Edit page), put {cms_module module='news' number='1'}
Then the summary of the latest news article will be displayed. You can use a custom template to display also the content. Then also use the parameter
summarytemplate='sometemplate.tpl':
Code: Select all
{cms_module module='news' number='1' summarytemplate='sometemplate.tpl'}
Then create a template file (you can just copy and paste the detail template to a new file in a text editor), save as
sometemplate.tpl and upload to the folder modules/News/templates.
That should work the way you want, instead of editing the module file.
Re: News layout
Posted: Sat Jan 28, 2006 4:59 pm
by musicscore
There are a lot of parameters with can be added to the news module command.
For a newbee this is very difficult to know what parameters.

(is there a list)
For example I want each news item with a blanco line between the text and the new news-item.
So
News
2e news
3the news
Is this possible
Please help.
Sory for my bad English !!!!!
Re: News layout
Posted: Wed Feb 01, 2006 7:02 pm
by musicscore
Thanxs for your help. I managed to set the space between the with CSS.
Now I want only to Display the News Link and the button but I cannot figure out what "parameter" I should use behind the news module !