class VirtualPage extends Page (View source)

Virtual Page creates an instance of a page, with the same fields that the original page had, but readonly.

This allows you can have a page in mulitple places in the site structure, with different children without duplicating the content.

Note: This Only duplicates $db fields and not the $has_one etc..

Properties

static $virtualFields
int $CopyContentFromID

Methods

array
getVirtualFields()

Generates the array of fields required for the page type.

array
getNonVirtualisedFields()

List of fields or properties to never virtualise

setCopyContentFromID($val)

No description

ContentSource()

No description

array
MetaComponents()

No description

allowedChildren()

No description

syncLinkTracking()

No description

bool
canPublish(Member $member = null)

We can only publish the page if there is a published source page

isPublishable()

Returns true if is page is publishable by anyone at all Return false if the source page isn't published yet.

getCMSFields()

Generate the CMS fields from the fields from the original page.

onBeforeWrite()

No description

getSettingsFields()

No description

validate()

No description

updateImageTracking() deprecated

No description

CMSTreeClasses()

No description

array
getViewerTemplates(string $suffix = '')

Use the target page's class name for fetching templates - as we need to take on its appearance

mixed
__get(string $field)

Allow attributes on the master page to pass through to the virtual page

getField($field)

No description

bool
isFieldVirtualised(string $field)

Check if given field is virtualised

mixed
__call(string $method, array $args)

Pass unrecognized method calls on to the original data object

bool
hasField(string $field)

No description

bool
hasMethod(string $method)

No description

string
castingHelper(string $field)

Return the "casting helper" (a piece of PHP code that when evaluated creates a casted value object) for a field on this object.

allMethodNames($custom = false)

{@inheritdoc}

getControllerName()

{@inheritdoc}

CopyContentFrom()

No description

Details

array getVirtualFields()

Generates the array of fields required for the page type.

Return Value

array

array getNonVirtualisedFields()

List of fields or properties to never virtualise

Return Value

array

setCopyContentFromID($val)

Parameters

$val

ContentSource()

array MetaComponents()

Return Value

array

allowedChildren()

syncLinkTracking()

bool canPublish(Member $member = null)

We can only publish the page if there is a published source page

Parameters

Member $member

Member to check

Return Value

bool

isPublishable()

Returns true if is page is publishable by anyone at all Return false if the source page isn't published yet.

Note that isPublishable doesn't affect ete from live, only publish.

getCMSFields()

Generate the CMS fields from the fields from the original page.

onBeforeWrite()

getSettingsFields()

validate()

updateImageTracking() deprecated

deprecated 4.2.0 Will be removed without equivalent functionality to replace it

CMSTreeClasses()

array getViewerTemplates(string $suffix = '')

Use the target page's class name for fetching templates - as we need to take on its appearance

Parameters

string $suffix

Return Value

array

mixed __get(string $field)

Allow attributes on the master page to pass through to the virtual page

Parameters

string $field

Return Value

mixed

getField($field)

Parameters

$field

bool isFieldVirtualised(string $field)

Check if given field is virtualised

Parameters

string $field

Return Value

bool

mixed __call(string $method, array $args)

Pass unrecognized method calls on to the original data object

Parameters

string $method
array $args

Return Value

mixed

bool hasField(string $field)

Parameters

string $field

Return Value

bool

bool hasMethod(string $method)

Parameters

string $method

Return Value

bool

string castingHelper(string $field)

Return the "casting helper" (a piece of PHP code that when evaluated creates a casted value object) for a field on this object.

Parameters

string $field

Return Value

string

allMethodNames($custom = false)

{@inheritdoc}

Parameters

$custom

getControllerName()

{@inheritdoc}

SiteTree CopyContentFrom()

Return Value

SiteTree