News layout
News layout
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
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
-
westis
Re: News layout
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:
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:
Hope I've made myself clear. I'm still half asleep early in the morning...
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}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;
}Re: News layout
Wow, this is a great enhancement. Great stuffwestis 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.
I understood it, so everybody else will I guesswestis wrote: Hope I've made myself clear. I'm still half asleep early in the morning...
Mambo sucks, that's why I am here.
Now they call it Joomla, but it still sucks!
CMSMS rules!
Now they call it Joomla, but it still sucks!
CMSMS rules!
Re: News layout
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
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
-
westis
Re: News layout
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:
Then set the width of each of those two columns in the stylesheet, something like this:
Hope that helps. 
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>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;
}Re: News layout
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
Once more thanks a lot
mrHref
Re: News layout
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
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
-
westis
Re: News layout
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':
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.
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'}That should work the way you want, instead of editing the module file.
-
musicscore
- Power Poster

- Posts: 498
- Joined: Wed Jan 25, 2006 11:53 am
Re: News layout
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 !!!!!
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 !!!!!
-
musicscore
- Power Poster

- Posts: 498
- Joined: Wed Jan 25, 2006 11:53 am
Re: News layout
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 !
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 !
