dft/silverstripe-featuredimage

Adds a featured image to selected DataObjects

Maintainers

👁 DFT

Package info

github.com/Dean-Forest-Tech/silverstripe-featuredimage

Homepage

Issues

Type:silverstripe-vendormodule

pkg:composer/dft/silverstripe-featuredimage

Statistics

Installs: 126

Dependents: 1

Suggesters: 0

Stars: 0

1.1.0 2024-11-21 12:06 UTC

Requires

Requires (Dev)

None

Suggests

None

Provides

None

Conflicts

None

Replaces

None

BSD-3-Clause 384787b2c863a45cc1c0e6f9eb3c38c39aa3c4f7

imagessilverstripefeatured

This package is auto-updated.

Last update: 2026-06-21 16:37:46 UTC


README

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