Heggsta\ElementalListing\Elements\ElementListing
An element that can be configured to list content from other sources
Synopsis
class ElementListing
extends BaseElement
{
- // constants
- const LISTING_TEMPLATES_PATH = 'Heggsta\\ElementalListing\\ListingTemplates';
- // members
- private static string $table_name = 'Heggsta_ElementListing';
- private static string $description = 'Listing element class';
- private static array $db = ;
- private static array $defaults = ;
- private static array $listing_type_source_map = ;
- private static string $icon = 'font-icon-block-file-list';
- private static string $controller_class = ElementListingController::class;
- private static array $file_template_sources = ;
- private static bool $cms_templates_disabled = false;
- private static string $template_sample_pagination = ;
- private static array $casting = ;
- private boolean $customTemplates = true;
- // methods
- public void getCMSFields()
- public string getType()
- protected array provideBlockSchema()
- protected string|null parentType()
- public void setCustomTemplates()
- protected array getSelectableFields()
- protected DataObject getListingSource()
- protected string getEffectiveSourceType()
- public ArrayList getComponentListingItems()
- public SS_List getListingItems()
- protected array getIdsFrom()
- public static array get_listing_template_files()
- public string getListing()
- public bool isComponentListing()
Hierarchy
Extends
- DNADesign\Elemental\Models\BaseElement
Constants
Name | Value |
---|---|
LISTING_TEMPLATES_PATH | 'Heggsta\\ElementalListing\\ListingTemplates' |
Members
private
- $casting
- $cms_templates_disabled — Heggsta\ElementalListing\Elements\bool
- $controller_class — string
- $customTemplates
- $db
- $defaults
- $description
- $file_template_sources
—
string
File system directory paths, relative to the project root. - $icon
- $listing_type_source_map
—
array
A mapping between ListType selected and the type of items that should be shown in the "Source" selection tree. If not specified in this mapping, it is assumed to be 'Page'. - $table_name
- $template_sample_pagination — string
Methods
protected
- getEffectiveSourceType() — Sometimes the type of a listing source will be different from that of the item being listed (eg a news article might be beneath a news holder instead of another news article) so we need to figure out what that is based on the settings for this page.
- getIdsFrom() — Recursively find all the child items that need to be listed
- getListingSource() — Some subclasses will want to override this.
- getSelectableFields()
- parentType()
- provideBlockSchema()
public
- getCMSFields()
- getComponentListingItems() — Retrieves all the component/relation listing items
- getListing()
- getListingItems() — Retrieves all the listing items within this source
- getType()
- get_listing_template_files() — Get a list of templates to use
- isComponentListing()
- setCustomTemplates() — Enable/disable fields for editable listing templates in the CMS