Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dean-forest-tech/silverstripe-featuredimage
Adds generic featured image to defined DataObjects and adds some extra helper methods
https://github.com/dean-forest-tech/silverstripe-featuredimage
Last synced: 5 days ago
JSON representation
Adds generic featured image to defined DataObjects and adds some extra helper methods
- Host: GitHub
- URL: https://github.com/dean-forest-tech/silverstripe-featuredimage
- Owner: Dean-Forest-Tech
- License: bsd-3-clause
- Created: 2022-05-06T11:25:32.000Z (over 2 years ago)
- Default Branch: 1
- Last Pushed: 2024-11-21T12:36:46.000Z (about 2 months ago)
- Last Synced: 2024-12-21T14:42:14.260Z (20 days ago)
- Language: PHP
- Size: 13.7 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: changelog.md
- License: LICENSE
Awesome Lists containing this project
README
# SilverStripe Featured Image
Adds generic featured image to defined DataObjects and adds some extra helper methods
## Instalation
Install via composer:
composer require "dft/silverstripe-featuredimage"
## Setup
First off you need to map the extension to the object you want to add
featured images to. You can do this via YML config:Path\To\My\Object:
extensions:
- DFT\SilverStripe\FeaturedImage\ObjectExtension**NOTE** By default, this module adds a featured image to `SiteTree ` (if the
CMS is installed).## Usage
By default this module adds a field `FeaturedImage` to the CMS for your
extended objects. This module also adds some simple helper methods:`Object::getFeaturedImagesFromHierachy()`: Get a list of images, first from
the current object and any parents, grandparents, etc. If the object
doesn't support hierachy, then only a list with one item is returned.`Object::getFeaturedImagesFromDescendants()`: Get a list of images, first from
the current object and any parents, grandparents, etc. If the object
doesn't support hierachy, then only a list with one item is returned.## Blog Module
If the blog module is installed, this module will copy featured image ID's into
the new FeaturedImageID on `SiteTree`