Update versioning.md

This commit is contained in:
Gabriele Brosulo 2014-11-06 11:31:55 +01:00
parent b64cfaf649
commit f2a059b148

View File

@ -165,8 +165,6 @@ 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
@ -188,6 +186,10 @@ from the `Controller` class.
## Recipes ## Recipes
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.
Keep in mind that `$SilverStripeNavigator` is only available on ContentController, so useful when the Versioned extension is applied to SiteTree (default), and not when it's applied to DataObject.
### Trapping the publication event ### Trapping the publication event
Sometimes, you'll want to do something whenever a particular kind of page is published. This example sends an email Sometimes, you'll want to do something whenever a particular kind of page is published. This example sends an email