News + Archive

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
snarfu
New Member
New Member
Posts: 5
Joined: Thu Dec 14, 2006 12:13 pm

News + Archive

Post by snarfu »

Hi,

i could use some help with the news module.

First some Infos about my System:
  • CMS Made Simple 1.0.2
  • PHP Version 4.3.10-16
  • MySQL 4.0.24
  • Apache/2.0.54 (Debian GNU/Linux)
I am not absolutely sure, which modules came with the standard package but i think FormBuilder is the only module which was installed after the installation of CMS Made Simple.

Ok, now for my problem or my nonunderstanding :)

I have a couple news with different categories. What i want to do is the following:
I have a page containing some graphics menu etc, the normal things. In the center i have a content block and on the right side i have a column where i can put stuff. Now i want to make something like a news archive in the following way.

In the center block the current news entry is visible. In the column to the right are all current news entries as a list. If i click on an older entry, the content in the center gets updated with the news entry which i just clicked on.

So far i have the list of nesentries on the right column with the following code:

Code: Select all

<td class="infoColumn">
  {news category="cat" summarytemplate="newsletter_archiv_summ.tpl" detailtemplate="newsletter_archiv_summ.tpl"}
</td>
newsletter_archiv_summ.tpl looks like this:

Code: Select all

<div class="arcNewsletterSummary">
<h3>Newsletter Archiv</h3>
{if $count>0}
<ul>
{foreach from=$items item=entry}
<li>{$entry->titlelink}</li>
{/foreach}
</ul>
{/if}
</div>
The content block in the center looks like this:

Code: Select all

<td class="contentColumn">
   <div class="breadcrumbs">
      {breadcrumbs delimiter="|"}
   </div>
    {news number="1" category="firmenbrief" summarytemplate="newsletter_archiv_main.tpl" detailtemplate="newsletter_archiv_detail.tpl"}
</td>
newsletter_archiv_main.tpl:

Code: Select all

{foreach from=$items item=entry}
   <div class="arcNewsletterWrapper">
      <h4>{$entry->title}</h4>
      <p>Die Themen:</p>
      {eval var=$entry->summary}
      <div class="printLink">
         {$entry->printlink}
      </div>
   </div>
{/foreach}
newsletter_archiv_detail.tpl

Code: Select all

<div class="arcNewsletterDetail">
   <h4>{$entry->title}</h4>
   <p>Die Themen:</p>
   {eval var=$entry->summary}
   <div class="printLink">
         {$entry->printlink}
      </div>
</div>
It looks good so far, but if i click on a link on the right column nothing really happens. The url changes but the center content is still the last added news entry of the specified category.

Any help here is realy appreciated.

Oh and CMS Made Simple is a great tool, i defenitely like it :)

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

Re: News + Archive

Post by Dr.CSS »

Do you have the {content} tag in the main part of the page some where...

News defaults to replace the content in the {content} tag, if not you need to add it even if you just put   in the content...

Or point it to a "News" page... with a content block in it... Like default install...
snarfu
New Member
New Member
Posts: 5
Joined: Thu Dec 14, 2006 12:13 pm

Re: News + Archive

Post by snarfu »

Ok, that helped already alot. Thank you.

Now another problem.

At the moment i have a column with the summary of all the news. If i click on an entry it is shown in the content block. Now which template does this content block use? The one i specified in the {news} tag? Do i understand it correct, that the summarytemplate == the code which replaces the {news} tag and the detailtemplate == the code that replaces the {content} tag?

And on to my second question. If i click on my archive page i have obviously an empty {content} tag, as the first page of the archive is the summary page (is that right?). Is there a way to show the latest added news entry right from the start without clicking on a specific entry first?

Thanks for the help so far.

Greetings
snarfu
New Member
New Member
Posts: 5
Joined: Thu Dec 14, 2006 12:13 pm

Re: News + Archive

Post by snarfu »

Ok, no edit function. One question i could answer myself. The detailtemplate is the template which will be used for the {content} block. Leaves only the thing with the first page.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: News + Archive

Post by Dr.CSS »

The summary template and the detail template just tell the news what to spit out, ie,. the date, author, summary content, detail content, etc... the detailpage="" tells it to go to a diff. page to show the detail and put it in the {content} of that page.

So if you want an archive you would put the news tag in the content of a "News" page with say newsletter_archiv_summ.tpl which will give you just the Title as a link to the details, if you don't give it a 'detail' template call it will use the default which has date. author, category, summary, detail, etc...

None of the templates you have/made call the Detail part of the News as in the default...


{eval var=$entry->content}


I use diff. templates and in the detail temp. I will take out the summary or at least make it not bold like the default...

So you can use the tags the way they are I would just suggest that you put the detail call in your detail template and if you have news on other pages and want to go to the News page to read the details  use the detailpage= call in the news tag...

The archive page needs the detail call in a detail template also, be it the default or a new one... but it doesn't need the detailpage= as it will stay on the News page...
beeswax

Re: News + Archive

Post by beeswax »

I have a problem, which I can't figure out if it relates to the above problem. I'm using the latest build 1.0.4 and starting from scratch to rebuild a school website. I've created 2 categories of news, Latest Newsletter and Archive. I assumed that by using the code on a page {cms_module module='news' news_category='Archive' number='5'} it would only call the items in the Archive category. However, it seems to be just showing the the news from the sidebar. I can't show you the page at the moment as I'm working on it locally. Thanks
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: News + Archive

Post by Dr.CSS »

To show just a certain category and not all use, category='Archive'...

From the News help, Extensions > Modules click the name of module or 'Help' to the  right...

(optional) category="category" - Only display items for that category. Use * after the name to show children. Multiple categories can be used if separated with a comma. Leaving empty, will show all categories.
Post Reply

Return to “CMSMS Core”