Merge branch '2.0'
This commit is contained in:
commit
5fd8fcb561
13
.travis.yml
13
.travis.yml
|
@ -7,13 +7,15 @@ env:
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- php: 5.6
|
- php: 5.6
|
||||||
env: DB=MYSQL PHPCS_TEST=1 PHPUNIT_TEST=1
|
env: DB=MYSQL RECIPE_VERSION=1.0.x-dev PHPCS_TEST=1 PHPUNIT_TEST=1
|
||||||
- php: 7.0
|
- php: 7.0
|
||||||
env: DB=MYSQL PHPUNIT_TEST=1
|
env: DB=MYSQL RECIPE_VERSION=1.1.x-dev PHPUNIT_TEST=1
|
||||||
- php: 7.1
|
- php: 7.1
|
||||||
env: DB=MYSQL PHPUNIT_COVERAGE_TEST=1
|
env: DB=MYSQL RECIPE_VERSION=4.2.x-dev PHPUNIT_COVERAGE_TEST=1
|
||||||
- php: 7.2
|
- php: 7.2
|
||||||
env: DB=MYSQL PHPUNIT_TEST=1
|
env: DB=PGSQL RECIPE_VERSION=4.3.x-dev PHPUNIT_TEST=1
|
||||||
|
- php: 7.3
|
||||||
|
env: DB=MYSQL RECIPE_VERSION=4.x-dev PHPUNIT_TEST=1
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
# Init PHP
|
# Init PHP
|
||||||
|
@ -23,7 +25,8 @@ before_script:
|
||||||
|
|
||||||
# Install composer dependencies
|
# Install composer dependencies
|
||||||
- composer validate
|
- composer validate
|
||||||
- composer require --no-update silverstripe/recipe-cms:1.0.x-dev
|
- composer require --no-update silverstripe/recipe-cms:"$RECIPE_VERSION"
|
||||||
|
- if [[ $DB == PGSQL ]]; then composer require --no-update silverstripe/postgresql:2.2.x-dev; fi
|
||||||
- composer install --prefer-dist --no-interaction --no-progress --no-suggest --optimize-autoloader --verbose --profile
|
- composer install --prefer-dist --no-interaction --no-progress --no-suggest --optimize-autoloader --verbose --profile
|
||||||
|
|
||||||
script:
|
script:
|
||||||
|
|
21
README.md
21
README.md
|
@ -8,8 +8,16 @@
|
||||||
|
|
||||||
## Introduction
|
## Introduction
|
||||||
|
|
||||||
The iframe module provides an IFrame page type that allows you to embed an IFrame into a page without resorting to
|
The IFrame module provides an IFrame page type in the CMS which allows you to embed an IFrame into a page without
|
||||||
custom code.
|
resorting to custom code in your templates or TinyMCE instance.
|
||||||
|
|
||||||
|
This can help if you have `iframe` disabled in TinyMCE's [valid_elements](https://www.tiny.cloud/docs-3x/reference/configuration/Configuration3x@valid_elements/)
|
||||||
|
and do not want to to re-enable it in for a single/specific use-case. It's also possible that using a Web Application
|
||||||
|
Firewall (WAF) may block page save requests that contain iframe elements in HTML content, which using this module would
|
||||||
|
circumvent.
|
||||||
|
|
||||||
|
Various attributes of the IFrame can be controlled from CMS fields, such as size and content that surrounds the
|
||||||
|
IFrame itself.
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
|
@ -19,8 +27,13 @@ custom code.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
Run `composer require silverstripe/iframe`, then append dev/build?flush=all to the website URL in your
|
Install with Composer:
|
||||||
browser. e.g. http://mysite.test/dev/build?flush=all
|
|
||||||
|
```
|
||||||
|
composer require silverstripe/iframe
|
||||||
|
```
|
||||||
|
|
||||||
|
After installation, ensure you run `dev/build?flush` in either your browser or via command line.
|
||||||
|
|
||||||
## Instructions
|
## Instructions
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
title: IFrame page
|
title: IFrame page
|
||||||
summary: Embed IFrames in your website without adding code
|
summary: Embed IFrames in your website without adding custom code
|
||||||
|
|
||||||
# IFrame
|
# IFrame
|
||||||
|
|
||||||
|
@ -8,29 +8,31 @@ summary: Embed IFrames in your website without adding code
|
||||||
* Create and modify an IFrame
|
* Create and modify an IFrame
|
||||||
|
|
||||||
## Before we begin
|
## Before we begin
|
||||||
Make sure that your SilverStripe installation has the [IFrame](http://addons.silverstripe.org/add-ons/silverstripe/iframe) module installed.
|
Make sure that your SilverStripe installation has the [IFrame](https://addons.silverstripe.org/add-ons/silverstripe/iframe) module installed.
|
||||||
|
|
||||||
This module provides a page type that you can use to embed IFrames in your website.
|
This module provides a page type that you can use to embed IFrames in your website.
|
||||||
|
|
||||||
## Creating an IFrame
|
## Creating an IFrame
|
||||||
|
|
||||||
IFrame pages are created like any other page. When you create a new page, selected the **I Frame Page** from the list of available page types.
|
IFrame pages are created like any other page. When you create a new page, select the **IFrame Page** from the list of
|
||||||
|
available page types.
|
||||||
|
|
||||||
There are a few new fields on an IFrame page.
|
There are a few extra fields on an IFrame page which can help you to customise the IFrame that gets created on the
|
||||||
|
frontend of your website.
|
||||||
|
|
||||||
The most important is *Iframe URL*: this is the URL that wish you display inside the IFrame. This can be an absolute
|
The most important is *IFrame URL*: this is the URL that wish you display inside the IFrame. This can be an absolute
|
||||||
path (ie, http://example.com/) or a relative path (ie, /about-us/). If it is a relative path then it will be assumed to
|
path (e.g. `http://example.com/`) or a relative path (e.g. `/about-us/`). If it is a relative path then it will be assumed to
|
||||||
be from the root of your site (ie, http://mysite.com/about-us/).
|
be from the root of your site (e.g `http://mysite.com/about-us/`).
|
||||||
|
|
||||||
*Auto height* will change the height of the IFrame to match the total height of the remote page.
|
"Auto height" will change the height of the IFrame to match the total height of the remote page.
|
||||||
_This will only work if the remote page is hosted on the same domain._
|
_This will only work if the remote page is hosted on the same domain._
|
||||||
|
|
||||||
If you check *Auto width* the IFrame will take up the entire width of the content area that it is in.
|
If you check "Auto width" the IFrame will take up the entire width of the content area that it is in.
|
||||||
|
|
||||||
You can manually set the height and width with the *Fixed height* and *Fixed width* fields.
|
You can manually set the height and width with the "Fixed height" and "Fixed width" fields.
|
||||||
The Auto width/height options must not be enabled for these fields to work.
|
The "Auto width/height" options must not be enabled for these fields to work.
|
||||||
|
|
||||||
The *Content* field has been broken up into three separate fields: one to display above the IFrame, one to display
|
The "Content" field has been broken up into three separate fields: one to display above the IFrame, one to display
|
||||||
beneath the IFrame, and another to display instead of the IFrame if the user has disabled them.
|
beneath the IFrame, and another to display instead of the IFrame if the user has disabled them.
|
||||||
|
|
||||||
## Known Issues
|
## Known Issues
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
Copyright (c) 2017, SilverStripe Limited
|
Copyright (c) 2019, SilverStripe Limited
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<ruleset name="SilverStripe">
|
<ruleset name="SilverStripe">
|
||||||
<description>CodeSniffer ruleset for SilverStripe coding conventions.</description>
|
<description>CodeSniffer ruleset for SilverStripe coding conventions.</description>
|
||||||
|
|
||||||
<rule ref="PSR2" >
|
<rule ref="PSR12" >
|
||||||
<!-- Current exclusions -->
|
<!-- Current exclusions -->
|
||||||
<exclude name="PSR1.Methods.CamelCapsMethodName" />
|
<exclude name="PSR1.Methods.CamelCapsMethodName" />
|
||||||
</rule>
|
</rule>
|
||||||
|
|
|
@ -2,11 +2,11 @@
|
||||||
|
|
||||||
namespace SilverStripe\IFrame;
|
namespace SilverStripe\IFrame;
|
||||||
|
|
||||||
use SilverStripe\CMS\Controllers\ContentController;
|
use PageController;
|
||||||
use SilverStripe\Control\Director;
|
use SilverStripe\Control\Director;
|
||||||
use SilverStripe\View\Requirements;
|
use SilverStripe\View\Requirements;
|
||||||
|
|
||||||
class IFramePageController extends ContentController
|
class IFramePageController extends PageController
|
||||||
{
|
{
|
||||||
protected function init()
|
protected function init()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue