AirNZ\SimpleSubsites\Extensions\SiteTreeExtension
Extension for the SiteTree object to add subsites support
Synopsis
class SiteTreeExtension
extends DataExtension
{
- // members
- private static array $has_one = ;
- private static array $many_many = ;
- private static array $many_many_extraFields = ;
- private static array $indexes = ;
- // methods
- public void augmentSQL()
- public void onBeforeWrite()
- public void updateCMSFields()
- public void alternateSiteConfig()
- public boolean canEdit()
- public boolean canCreate()
- public boolean canDelete()
- public boolean canAddChildren()
- public boolean canPublish()
- public void duplicateToSubsitePrep()
- public void duplicateToSubsite()
- public void duplicateSubsiteRelations()
- public void alternateAbsoluteLink()
- public void updatePreviewLink()
- public void MetaTags()
- public void cacheKeyComponent()
Hierarchy
Extends
- SilverStripe\ORM\DataExtension
Members
private
- $has_one
- $indexes
- $many_many
- $many_many_extraFields
Methods
public
- MetaTags() — Inject the subsite ID into the content so it can be used by frontend scripts.
- alternateAbsoluteLink()
- alternateSiteConfig()
- augmentSQL() — Update any requests to limit the results to the current site
- cacheKeyComponent() — Return a piece of text to keep DataObject cache keys appropriately specific
- canAddChildren()
- canCreate()
- canDelete()
- canEdit() — Only allow editing of a page if the member satisfies one of the following conditions: - Is in a group which has access to the subsite this page belongs to - Is in a group with edit permissions on the "main site"
- canPublish()
- duplicateSubsiteRelations() — Duplicate relations using a static property to define which ones we want to duplicate
- duplicateToSubsite() — Create a duplicate of this page and save it to another subsite
- duplicateToSubsitePrep() — Does the basic duplication, but doesn't write anything this means we can subclass this easier and do more complex relation duplication.
- onBeforeWrite()
- updateCMSFields()
- updatePreviewLink() — Use the CMS domain for iframed CMS previews to prevent single-origin violations and SSL cert problems.