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

string
MetaTags(bool $includeTitle = true)

For VirtualPage, add a canonical link tag linking to the original page See TRAC #6828 & http://support.google.com/webmasters/bin/answer.py?hl=en&answer=139394

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

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()

string MetaTags(bool $includeTitle = true)

For VirtualPage, add a canonical link tag linking to the original page See TRAC #6828 & http://support.google.com/webmasters/bin/answer.py?hl=en&answer=139394

Parameters

bool $includeTitle

Show default -tag, set to false for custom templating</p></td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>string</td> <td><p>The XHTML metatags</p></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_allowedChildren"> <div class="location"><a href="https://github.com/silverstripe/silverstripe-cms/blob/master/code/Model/VirtualPage.php#L157">at line 157</a></div> <code> <strong>allowedChildren</strong>() </code> </h3> <div class="details"> <div class="tags"> </div> </div> </div> <div class="method-item"> <h3 id="method_syncLinkTracking"> <div class="location"><a href="https://github.com/silverstripe/silverstripe-cms/blob/master/code/Model/VirtualPage.php#L166">at line 166</a></div> <code> <strong>syncLinkTracking</strong>() </code> </h3> <div class="details"> <div class="tags"> </div> </div> </div> <div class="method-item"> <h3 id="method_canPublish"> <div class="location"><a href="https://github.com/silverstripe/silverstripe-cms/blob/master/code/Model/VirtualPage.php#L183">at line 183</a></div> <code> bool <strong>canPublish</strong>(<a href="../../../SilverStripe/Security/Member.html"><abbr title="SilverStripe\Security\Member">Member</abbr></a> $member = null) </code> </h3> <div class="details"> <div class="method-description"> <p><p>We can only publish the page if there is a published source page</p></p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td><a href="../../../SilverStripe/Security/Member.html"><abbr title="SilverStripe\Security\Member">Member</abbr></a></td> <td>$member</td> <td><p>Member to check</p></td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>bool</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_isPublishable"> <div class="location"><a href="https://github.com/silverstripe/silverstripe-cms/blob/master/code/Model/VirtualPage.php#L194">at line 194</a></div> <code> <strong>isPublishable</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p><p>Returns true if is page is publishable by anyone at all Return false if the source page isn't published yet.</p></p> <p><p>Note that isPublishable doesn't affect ete from live, only publish.</p></p> </div> <div class="tags"> </div> </div> </div> <div class="method-item"> <h3 id="method_getCMSFields"> <div class="location"><a href="https://github.com/silverstripe/silverstripe-cms/blob/master/code/Model/VirtualPage.php#L217">at line 217</a></div> <code> <strong>getCMSFields</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p><p>Generate the CMS fields from the fields from the original page.</p></p> </div> <div class="tags"> </div> </div> </div> <div class="method-item"> <h3 id="method_onBeforeWrite"> <div class="location"><a href="https://github.com/silverstripe/silverstripe-cms/blob/master/code/Model/VirtualPage.php#L289">at line 289</a></div> <code> <strong>onBeforeWrite</strong>() </code> </h3> <div class="details"> <div class="tags"> </div> </div> </div> <div class="method-item"> <h3 id="method_getSettingsFields"> <div class="location"><a href="https://github.com/silverstripe/silverstripe-cms/blob/master/code/Model/VirtualPage.php#L320">at line 320</a></div> <code> <strong>getSettingsFields</strong>() </code> </h3> <div class="details"> <div class="tags"> </div> </div> </div> <div class="method-item"> <h3 id="method_validate"> <div class="location"><a href="https://github.com/silverstripe/silverstripe-cms/blob/master/code/Model/VirtualPage.php#L342">at line 342</a></div> <code> <strong>validate</strong>() </code> </h3> <div class="details"> <div class="tags"> </div> </div> </div> <div class="method-item"> <h3 id="method_updateImageTracking"> <div class="location"><a href="https://github.com/silverstripe/silverstripe-cms/blob/master/code/Model/VirtualPage.php#L366">at line 366</a></div> <code> <strong>updateImageTracking</strong>() <small><span class="label label-danger">deprecated</span></small></code> </h3> <div class="details"> <p> <small><span class="label label-danger">deprecated</span></small> <tr> <td>4.2..5.0</td> <td></td> </tr> </p> <div class="tags"> </div> </div> </div> <div class="method-item"> <h3 id="method_CMSTreeClasses"> <div class="location"><a href="https://github.com/silverstripe/silverstripe-cms/blob/master/code/Model/VirtualPage.php#L387">at line 387</a></div> <code> <strong>CMSTreeClasses</strong>() </code> </h3> <div class="details"> <div class="tags"> </div> </div> </div> <div class="method-item"> <h3 id="method_getViewerTemplates"> <div class="location"><a href="https://github.com/silverstripe/silverstripe-cms/blob/master/code/Model/VirtualPage.php#L402">at line 402</a></div> <code> array <strong>getViewerTemplates</strong>(string $suffix = '') </code> </h3> <div class="details"> <div class="method-description"> <p><p>Use the target page's class name for fetching templates - as we need to take on its appearance</p></p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>string</td> <td>$suffix</td> <td></td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>array</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method___get"> <div class="location"><a href="https://github.com/silverstripe/silverstripe-cms/blob/master/code/Model/VirtualPage.php#L419">at line 419</a></div> <code> mixed <strong>__get</strong>(string $field) </code> </h3> <div class="details"> <div class="method-description"> <p><p>Allow attributes on the master page to pass through to the virtual page</p></p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>string</td> <td>$field</td> <td></td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>mixed</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_getField"> <div class="location"><a href="https://github.com/silverstripe/silverstripe-cms/blob/master/code/Model/VirtualPage.php#L433">at line 433</a></div> <code> <strong>getField</strong>($field) </code> </h3> <div class="details"> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td></td> <td>$field</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_isFieldVirtualised"> <div class="location"><a href="https://github.com/silverstripe/silverstripe-cms/blob/master/code/Model/VirtualPage.php#L447">at line 447</a></div> <code> bool <strong>isFieldVirtualised</strong>(string $field) </code> </h3> <div class="details"> <div class="method-description"> <p><p>Check if given field is virtualised</p></p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>string</td> <td>$field</td> <td></td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>bool</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method___call"> <div class="location"><a href="https://github.com/silverstripe/silverstripe-cms/blob/master/code/Model/VirtualPage.php#L472">at line 472</a></div> <code> mixed <strong>__call</strong>(string $method, array $args) </code> </h3> <div class="details"> <div class="method-description"> <p><p>Pass unrecognized method calls on to the original data object</p></p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>string</td> <td>$method</td> <td></td> </tr> <tr> <td>array</td> <td>$args</td> <td></td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>mixed</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_hasField"> <div class="location"><a href="https://github.com/silverstripe/silverstripe-cms/blob/master/code/Model/VirtualPage.php#L485">at line 485</a></div> <code> bool <strong>hasField</strong>(string $field) </code> </h3> <div class="details"> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>string</td> <td>$field</td> <td></td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>bool</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_castingHelper"> <div class="location"><a href="https://github.com/silverstripe/silverstripe-cms/blob/master/code/Model/VirtualPage.php#L501">at line 501</a></div> <code> string <strong>castingHelper</strong>(string $field) </code> </h3> <div class="details"> <div class="method-description"> <p><p>Return the "casting helper" (a piece of PHP code that when evaluated creates a casted value object) for a field on this object.</p></p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>string</td> <td>$field</td> <td></td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>string</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_allMethodNames"> <div class="location"><a href="https://github.com/silverstripe/silverstripe-cms/blob/master/code/Model/VirtualPage.php#L513">at line 513</a></div> <code> <strong>allMethodNames</strong>($custom = false) </code> </h3> <div class="details"> <div class="method-description"> <p><p>{@inheritdoc}</p></p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td></td> <td>$custom</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_getControllerName"> <div class="location"><a href="https://github.com/silverstripe/silverstripe-cms/blob/master/code/Model/VirtualPage.php#L527">at line 527</a></div> <code> <strong>getControllerName</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p><p>{@inheritdoc}</p></p> </div> <div class="tags"> </div> </div> </div> <div class="method-item"> <h3 id="method_CopyContentFrom"> <div class="location"><a href="https://github.com/silverstripe/silverstripe-cms/blob/master/code/Model/VirtualPage.php#L28">at line 28</a></div> <code> <a href="../../../SilverStripe/CMS/Model/SiteTree.html"><abbr title="SilverStripe\CMS\Model\SiteTree">SiteTree</abbr></a> <strong>CopyContentFrom</strong>() </code> </h3> <div class="details"> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td><a href="../../../SilverStripe/CMS/Model/SiteTree.html"><abbr title="SilverStripe\CMS\Model\SiteTree">SiteTree</abbr></a></td> <td></td> </tr> </table> </div> </div> </div> </div> </div><div id="footer"> Generated by <a href="https://github.com/code-lts/doctum">Doctum, a API Documentation generator and fork of Sami</a>. <br/>Contributions to this documentation repository are welcomed <a href="https://github.com/silverstripe/api.silverstripe.org" rel="noreferrer noopener" target="_blank">on Github!</a> </div></div> </div> </body> </html>