Update versioning.md

Added information about $SilverStripeNavigator
This commit is contained in:
Gabriele Brosulo 2014-11-06 10:55:32 +01:00
parent 646a57c324
commit b64cfaf649

View File

@ -165,6 +165,8 @@ It checks for a `Stage` GET parameter, so you can force
a draft stage by appending `?stage=Stage` to your request. The setting is "sticky" a draft stage by appending `?stage=Stage` to your request. The setting is "sticky"
in the PHP session, so any subsequent requests will also be in draft stage. in the PHP session, so any subsequent requests will also be in draft stage.
It can be useful to add the variable `$SilverStripeNavigator` somewhere into the template, since it allows you to put a mini "admin" bar on the page which isn't visible to non editors. It shows the current stage and provides a convenient CMS link and version changing link.
Important: The `choose_site_stage()` call only deals with setting the default stage, Important: The `choose_site_stage()` call only deals with setting the default stage,
and doesn't check if the user is authenticated to view it. As with any other controller logic, and doesn't check if the user is authenticated to view it. As with any other controller logic,
please use `DataObject->canView()` to determine permissions, and avoid exposing unpublished please use `DataObject->canView()` to determine permissions, and avoid exposing unpublished