SilverStripe\Subsites\Extensions\SiteTreeSubsites
Extension for the SiteTree object to add subsites support
Synopsis
class SiteTreeSubsites
extends DataExtension
{
- // members
- private static array $has_one = ;
- private static array $many_many = ;
- private static array $many_many_extraFields = ;
- // methods
- public void isMainSite()
- public void augmentSQL()
- public void onBeforeWrite()
- public void updateCMSFields()
- public SiteTree duplicateToSubsitePrep()
- public void onBeforeDuplicate()
- public SiteTree duplicateToSubsite()
- public void duplicateSubsiteRelations()
- public SiteConfig alternateSiteConfig()
- public bool|null canEdit()
- public bool canDelete()
- public bool canAddChildren()
- public bool|null canPublish()
- public static void contentcontrollerInit()
- public string alternateAbsoluteLink()
- public string updatePreviewLink()
- public string alternatePreviewLink()
- public string MetaTags()
- public void augmentSyncLinkTracking()
- public null|bool augmentValidURLSegment()
- public void cacheKeyComponent()
- public boolean|null canCreate()
Hierarchy
Extends
- SilverStripe\ORM\DataExtension
Members
private
- $has_one
- $many_many
- $many_many_extraFields
Methods
public
- MetaTags() — Inject the subsite ID into the content so it can be used by frontend scripts.
- alternateAbsoluteLink()
- alternatePreviewLink() — This function is marked as deprecated for removal in 5.0.0 in silverstripe/cms so now simply passes execution to where the functionality exists for backwards compatiblity.
- alternateSiteConfig()
- augmentSQL() — Update any requests to limit the results to the current site
- augmentSyncLinkTracking()
- augmentValidURLSegment() — Ensure that valid url segments are checked within the correct subsite of the owner object, even if the current subsiteID is set to some other subsite.
- 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()
- contentcontrollerInit() — Called by ContentController::init();
- 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.
- isMainSite()
- onBeforeDuplicate() — When duplicating a page, assign the current subsite ID from the state
- onBeforeWrite()
- updateCMSFields()
- updatePreviewLink() — Use the CMS domain for iframed CMS previews to prevent single-origin violations and SSL cert problems. Always set SubsiteID to avoid errors because a page doesn't exist on the CMS domain.