News Layout

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Locked
kristjansson

News Layout

Post by kristjansson »

Hi,

I'm new to CMSMS and I've been having some troubles with the news module. For example putting style on the "Titlelink" and assigning templates.

Is there somewhere I can see what attributes go with the news module and how to use them?

thanks
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: News Layout

Post by Dr.CSS »

from the default install, a news CSS style sheet exist... if you put the news in a page then have your browser show the page you can right clik and view source, there you can see which class is asigned to which words you are trying to style...

.NewsSummary {
    margin-bottom: 10px;
}

.NewsSummaryCategory {
  font-style: italic;
  margin: 5px 0;
}

.NewsSummaryPostdate {
  font-size: 90%;
  font-weight: bold;
}

.NewsSummarySummary, .NewsSummaryContent {
  line-height: 140%;
  margin-bottom: 10px;
}

#NewsPostDetailDate {
  font-size: 90%;
  font-style: italic;
  margin-bottom: 5px;
  }

#NewsPostDetailSummary {
  margin-bottom: 10px;
  line-height: 150%;
  }

#NewsPostDetailContent {
  margin-bottom: 15px;
  line-height: 150%;
  }

/* to add specific style to the below div, uncomment them. */
/*
.NewsSummaryLink {}
.NewsSummaryAuthor {}
.NewsSummaryMorelink {}
#NewsPostDetailTitle {}
#NewsPostDetailHorizRule {}
#NewsPostDetailCategory {}
#NewsPostDetailAuthor {}
#NewsPostDetailAuthor {}
#NewsPostDetailPrintLink {}
#NewsPostDetailReturnLink {}
*/
kristjansson

Re: News Layout

Post by kristjansson »

Thank you, I've got it to work - found out wich styles to use and then I had to add the "a" to make it work on the title link

.NewsSummaryLink {} is the style on the news title, and if it's a link then use .NewsSummaryLink a {}


But I'm still kinda lost when it comes to creating and assigning a template to the news module. Any ideas?
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: News Layout

Post by Dr.CSS »

if you mean styling that's the way to do it... if you mean the template for the way it get parsed and spit out you can copy the default and make a new one by changing the order things are output or even what shows up at all...
one thing i found to be useful is to just take out the actual call as in...
a slightly changed default...
once you get it the way you want it, it can be done in the main news area for testing, if you don't want to change the default for all news you can then copy/paste it to a new file then hit the Restore to Defaults button and it will revert to the default, you can put  "yournewtemplate.tpl" in the the template folder of the news module, FTP wise, and then when you want to use it just use the calls in your tag...

{cms_module module="news" summarytemplate="yournewtemplate.tpl" detailtemplate="yournewtemplate.tpl" }

{$entry->title}

{if $entry->category}

{$entry->category}

{/if}

{if $entry->formatpostdate}

{$entry->formatpostdate}

{/if}

{if $entry->summary}


        i didn't want a summary on the detail view so i just took out the  {eval var=$entry->summary}


{/if}

{if $entry->author}

{$entry->author}

{/if}


{eval var=$entry->content}





{if $return_url != ""}
{$return_url}
{/if} {cms_module module="comments" modulename="News"  pageid=$entry->id emailfield=1 websitefield=1 spamprotect=1 notify="blogcom@multiintech.com"}  this is how i add a comment link at the bottom of the article....
Locked

Return to “Layout and Design (CSS & HTML)”