Hi Mates,
Ive been following the tutorials here: https://www.silverstripe.org/learn/lessons/ for creating an article system
which has been great. Got it working and very happy.
Ive then gone on to add the homepage controller which will show the 'Latest news' from the article page holder.
Which again has worked great.
My question is:
I have a number of different pages which relate to the categories on the article page. I would like to just to show the articles relating there category on different pages
EG:
Apartment Development Page
---------> Displays the latest 3 articles from the News page with the category Apartment Development on to the Apartment Development Page
Retire Page
---------> Displays the latest 3 articles from the News page with the category Retire on to the Retire Page
ATM the Apartment Develeopment page will show all of the articles(Apartment Development, Retire, Home & Land etc). I need it to just show the Apartment Development Articles on the Apartment Development Page. So on for the other pages.
ApartmentDeveleopment.php
---------------------------------------------------------------
class ApartmentDeveleopment_Controller extends Page_Controller{
public function LatestArticles($count = 3){
return ArticlePage::get()
-> sort('Created', 'DESC')
->limit($count);
}
}
I am new to Sliverstripe and slowly learning this cool CMS. If some one could point me in the right direction i would be VERY graeteful!
Many Thanks