diff --git a/src/IFramePage.php b/src/IFramePage.php index fffe512..b8ed365 100644 --- a/src/IFramePage.php +++ b/src/IFramePage.php @@ -8,6 +8,8 @@ use SilverStripe\Forms\CheckboxField; use SilverStripe\Forms\NumericField; use SilverStripe\Forms\HTMLEditor\HtmlEditorField; use SilverStripe\ORM\FieldType\DBField; +use SilverStripe\ORM\ValidationException; +use SilverStripe\ORM\ValidationResult; /** * Iframe page type embeds an iframe of URL of choice into the page. @@ -18,6 +20,7 @@ class IFramePage extends Page { private static $db = array( 'IFrameURL' => 'Text', + 'IFrameTitle' => 'Varchar', 'AutoHeight' => 'Boolean(1)', 'AutoWidth' => 'Boolean(1)', 'FixedHeight' => 'Int(500)', @@ -45,7 +48,11 @@ class IFramePage extends Page $fields = parent::getCMSFields(); $fields->removeFieldFromTab('Root.Main', 'Content'); - $fields->addFieldToTab('Root.Main', $url = new TextField('IFrameURL', 'Iframe URL')); + $fields->addFieldsToTab('Root.Main', [ + $url = TextField::create('IFrameURL', 'Iframe URL'), + TextField::create('IFrameTitle', 'Description of contents (title)') + ->setDescription(_t(__CLASS__ . '.TITLE_DESCRIPTION', 'Used by screen readers')), + ]); $url->setRightTitle( DBField::create_field( 'HTMLText', diff --git a/templates/SilverStripe/IFrame/Layout/IFramePage.ss b/templates/SilverStripe/IFrame/Layout/IFramePage.ss index 3a4fe24..e132d50 100644 --- a/templates/SilverStripe/IFrame/Layout/IFramePage.ss +++ b/templates/SilverStripe/IFrame/Layout/IFramePage.ss @@ -9,7 +9,7 @@
<%t SilverStripe\\IFrame\\IFramePage.ExternalNote "Please note the following section of content is possibly being delivered from an external source (IFRAME in HTML terms), and may present unusual experiences for screen readers." %>
- + <% end_if %> $BottomContent