Source of file FaqOnePage.php
Size: 1,622 Bytes - Last Modified: 2021-12-23T10:41:37+00:00
/var/www/docs.ssmods.com/process/src/src/FaqOnePage.php
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 | <?php namespace Sunnysideup\Faqs; use Page; use SilverStripe\Forms\HTMLEditor\HTMLEditorField; use SilverStripe\Forms\TextField; /** *@author nicolaas[at] sunnysideup.co.nz *@description: individual FAQ page. Usually, these are not viewed as they can be read completely from the parent (FAQ HOLDER) page. */ class FaqOnePage extends Page { private static $table_name = 'FaqOnePage'; private static $icon = 'sunnysideup/faqs: client/images/FaqOnePage-file.png'; private static $description = 'Individual FAQ Page, displays the answer to one question'; private static $default_parent = FaqHolderPage::class; private static $can_be_root = false; private static $allowed_children = 'none'; private static $defaults = [ 'ShowInMenus' => 0, ]; /** * Standard SS variable. */ private static $singular_name = 'FAQ Page'; /** * Standard SS variable. */ private static $plural_name = 'FAQ Pages'; public function i18n_singular_name() { return _t('FAQPage.SINGULARNAME', 'FAQ Page'); } public function i18n_plural_name() { return _t('FAQPage.PLURALNAME', 'FAQ Pages'); } //private static $has_many = array(); public function getCMSFields() { $fields = parent::getCMSFields(); $fields->replaceField('Title', new TextField('Title', 'Question')); $fields->replaceField('MenuTitle', new TextField('MenuTitle', 'Question - short version for menus')); $fields->replaceField('Content', new HTMLEditorField('Content', 'Answer')); return $fields; } } |