weboftalent / page-with-image
Same as a standard page but with the addition of a main image
Installs: 187
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 1
Open Issues: 1
Type:silverstripe-module
Requires
- micschk/silverstripe-liveseo: dev-master
- silverstripe/framework: ~3.1
- weboftalent/twitter-tools: ~1
This package is auto-updated.
Last update: 2024-10-27 08:20:56 UTC
README
Maintainers
- Gordon Anderson (Nickname: nontgor) gordon.b.anderson@gmail.com
##Introduction
This module provides for rendering subpages as images of folders, which themselves can contain similar folders. Images can also be attached to third party module page types and rendered in the same way.
##Documentation
Provided Page Types
A PageWithImage is container within a PageWithImageFolder. Both are the same as a standard Page, but with the addition of a main image (MainImage field).
Extending Provided Page Types
One can simply extend PageWithImage adding whatever is needed for the subclass as appropriate.
class AnimalPage extends PageWithImage { private static $db = array('Name' => 'Varchar'); }
The above class AnimalPage will appear when right clicking on a PageWithImageFolder to add a new subpage.
Using the AddImageExtension
There are 2 configuration changes required for a Page type that does not already have an attached image.
- Add the AddImageExtension
- Allow the third party Page type be a child of PageWithImageFolder (otherwise you can't add it) To do this add a config file, say pagewithimage.yml in your own module or mysite/_config directory with YML as per the following:
--- Name: yoursitepagewithimage After: pagewithimage --- PageWithImageFolder: allowed_children: - PageWithImage - ThirdPartyPage ThirdPartyPage: extensions: - AddImageExtension
Repeat for each ThirdPartyPage type that you would like to have an image.
##Requirements
- SilverStripe 3.1
##TODO
- Tests