News layout

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
mrHref
New Member
New Member
Posts: 7
Joined: Tue Nov 22, 2005 10:47 pm

News layout

Post 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
westis

Re: News layout

Post 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...
User avatar
petert
Power Poster
Power Poster
Posts: 282
Joined: Wed Feb 09, 2005 9:30 pm

Re: News layout

Post 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
Mambo sucks, that's why I am here.
Now they call it Joomla, but it still sucks!

CMSMS rules!
mrHref
New Member
New Member
Posts: 7
Joined: Tue Nov 22, 2005 10:47 pm

Re: News layout

Post 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
westis

Re: News layout

Post 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. :D
mrHref
New Member
New Member
Posts: 7
Joined: Tue Nov 22, 2005 10:47 pm

Re: News layout

Post 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  :D
mrHref
   
mrHref
New Member
New Member
Posts: 7
Joined: Tue Nov 22, 2005 10:47 pm

Re: News layout

Post 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
 
westis

Re: News layout

Post 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.
musicscore
Power Poster
Power Poster
Posts: 498
Joined: Wed Jan 25, 2006 11:53 am

Re: News layout

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

Re: News layout

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

Return to “CMSMS Core”