\NewsHolder
A top level page that contains news articles
- Author: Marcus Nyeholt <marcus@silverstripe.com.au>
- License: BSD License http://silverstripe.org/bsd-license/
Synopsis
class NewsHolder
extends Page
{
- // members
- private static array $db = ;
- private static array $defaults = ;
- private static string $icon = 'news/images/newsholder';
- private static array $allowed_children = ;
- private static boolean $automatic_filing = true;
- protected integer $numberToDisplay = 10;
- // methods
- public FieldSet getCMSFields()
- public void onBeforeWrite()
- public DataObjectSet Articles()
- public DataObjectSet SubSections()
- public NewsHolder Section()
- public void findSection()
- public void getPartitionedHolderForArticle()
- public void dateFolder()
- public Array pagesAffectedByChanges()
- public Array TotalChildArticles()
Hierarchy
Extends
- Page
Members
private
- $allowed_children
- $automatic_filing
—
boolean
Should this news article be automatically filed into a year/month/date folder on creation. - $db
- $defaults
- $icon
protected
- $numberToDisplay
—
int
A bit of a cheat way of letting the template determine how many articles to display.
Methods
public
- Articles() — Returns a list of articles within this news holder.
- Section() — Maintain API compatibility with NewsArticle
- SubSections() — Returns a list of sub news sections, if available
- TotalChildArticles() — We do not want to use NewsHolder->SubSections because this splits the paginations into the categories the articles are in which means the pagination will not work or will display multiple times
- dateFolder() — Finds or creates a new child object based on a given name
- findSection() — Find the section this news article is currently in, based on ancestor pages
- getCMSFields() — Gets the fields to display for this news holder in the CMS
- getPartitionedHolderForArticle() — Gets an appropriate sub article holder for the given article page
- onBeforeWrite()
- pagesAffectedByChanges() — Pages to update cache file for static publisher