mirror of
https://github.com/silverstripe/silverstripe-iframe
synced 2024-10-22 09:05:51 +00:00
FEATURE: Allow content at top and bottom of iframe
This commit is contained in:
parent
43ab1f81bb
commit
d2345539c6
@ -4,7 +4,9 @@ class IFramePage extends Page {
|
|||||||
static $db = array(
|
static $db = array(
|
||||||
'IFrameUrl' => 'Text',
|
'IFrameUrl' => 'Text',
|
||||||
'DynamicHeight' => 'Boolean',
|
'DynamicHeight' => 'Boolean',
|
||||||
'FixedHeight' => 'Int'
|
'FixedHeight' => 'Int',
|
||||||
|
'AlternateContent' => 'HTMLText',
|
||||||
|
'BottomContent' => 'HTMLText'
|
||||||
);
|
);
|
||||||
|
|
||||||
function getCMSFields() {
|
function getCMSFields() {
|
||||||
@ -14,7 +16,10 @@ class IFramePage extends Page {
|
|||||||
$fields->addFieldToTab('Root.Content.Main', new TextField('IFrameUrl', 'IFrame URL'));
|
$fields->addFieldToTab('Root.Content.Main', new TextField('IFrameUrl', 'IFrame URL'));
|
||||||
//$fields->addFieldToTab('Root.Content.Main', new CheckboxField('DynamicHeight', 'Dynamically resize the IFrame height (this doesn\'t work if IFrame URL is on a different domain)'));
|
//$fields->addFieldToTab('Root.Content.Main', new CheckboxField('DynamicHeight', 'Dynamically resize the IFrame height (this doesn\'t work if IFrame URL is on a different domain)'));
|
||||||
$fields->addFieldToTab('Root.Content.Main', new NumericField('FixedHeight', 'Fixed Height (in pixels)'));
|
$fields->addFieldToTab('Root.Content.Main', new NumericField('FixedHeight', 'Fixed Height (in pixels)'));
|
||||||
$fields->addFieldToTab('Root.Content.Main', new HtmlEditorField('Content', 'Alternate Content'));
|
$fields->addFieldToTab('Root.Content.Main', new HtmlEditorField('Content', 'Content (appears above IFrame)'));
|
||||||
|
$fields->addFieldToTab('Root.Content.Main', new HtmlEditorField('BottomContent', 'Content (appears below IFrame)'));
|
||||||
|
$fields->addFieldToTab('Root.Content.Main', new HtmlEditorField('AlternateContent', 'Alternate Content (appears when user has IFrames disabled)'));
|
||||||
|
|
||||||
|
|
||||||
return $fields;
|
return $fields;
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,9 @@
|
|||||||
<div class="typography">
|
<div class="typography">
|
||||||
<h2>$Title</h2>
|
<h2>$Title</h2>
|
||||||
|
|
||||||
|
$Content
|
||||||
<iframe id="IFramePageIFrame" src="$IFrameUrl" $Height>
|
<iframe id="IFramePageIFrame" src="$IFrameUrl" $Height>
|
||||||
$Content
|
$AlternateContent
|
||||||
</iframe>
|
</iframe>
|
||||||
|
$BottomContent
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user