FORUM IS CLOSED. PLEASE USE QUESTIONS / ANSWERS PAGE INSTEAD
Login  |  Forum  |  Search   

Board index » Development » Help requests




Post new topic Reply to topic  [ 3 posts ] 
 
Author Message
 Post subject: Multiple News Categories
 Post Posted: Fri Jul 22, 2011 10:23 am 
Offline

Joined: Sat Jul 02, 2011 7:15 am
Posts: 5
Hi,

I've got the news/blog plugin 1.01 installed and it's working fine.

I'm now trying to create 2 different NEWS categories to be displayed on the front page, one being "Top News" and another being "Articles".

I'm using the following to display the "Top News" content on my front page:
Code:
<?php
            $newsZone = $site->getZoneByModule('display_content', 'news_blog');
            $limit = 3;
            //$layout = 'blog'; //blog style - long long page with all information from all articles.
            //$layout = 'news'; //title date and first paragraph of text.
            $layout = 'newsIntro'; //title date and first widget (with photos or anything else.
            echo $newsZone->generateNews($limit, $layout);
            ?>

I'd like to similarly display article contents without causing conflict with the "Top News".

Any ideas on how to achieve this?


Top 
 Profile  
 
 Post subject: Re: Multiple News Categories
 Post Posted: Sun Jul 24, 2011 6:25 am 
Offline
Project Developer

Joined: Tue Apr 28, 2009 9:43 am
Posts: 1720
If you go to "Developer -> Zones" tab, you will see a zone "news". Pres "New record" and insert one more zone with all the same fields like "news" zone, except the name and title. Write "articles" instead of "news".

Add "articles" zone to associated zones of menu management http://www.impresspages.org/docs/config ... iguration/


Print your top news:
Code:

<?php
            $newsZone = $site->getZone('news');
            $limit = 3;
            //$layout = 'blog'; //blog style - long long page with all information from all articles.
            //$layout = 'news'; //title date and first paragraph of text.
            $layout = 'newsIntro'; //title date and first widget (with photos or anything else.
            echo $newsZone->generateNews($limit, $layout);
?>



Print Articles:

Code:

<?php
            $newsZone = $site->getZone('articles');
            $limit = 3;
            //$layout = 'blog'; //blog style - long long page with all information from all articles.
            //$layout = 'news'; //title date and first paragraph of text.
            $layout = 'newsIntro'; //title date and first widget (with photos or anything else.
            echo $newsZone->generateNews($limit, $layout);
?>



Top 
 Profile  
 
 Post subject: Re: Multiple News Categories
 Post Posted: Sun Jul 24, 2011 3:58 pm 
Offline

Joined: Sat Jul 02, 2011 7:15 am
Posts: 5
Absolutely amazing, works perfectly. Thanks! :D


Top 
 Profile  
 
Display posts from previous:  Sort by  
 
Post new topic Reply to topic  [ 3 posts ] 

Board index » Development » Help requests


 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron