Update Documentation

* Updated graphics
* Updated information around global dropdown
* Added Information about supporting subsites in modeladmins
* Changed 'working.md' to 'working_with.md', for clearer menu naming
This commit is contained in:
Naomi Guyer 2013-09-12 14:42:00 +12:00
parent 110ce7751d
commit a76b3c7808
10 changed files with 72 additions and 36 deletions

View File

@ -70,18 +70,12 @@ Note that every site also has a ''www.''-prefixed version of the domain availabl
### Strict Subdomain Matching ###
The module tries to provide sensible defaults, in which it regards `example.com` and `www.example.com`
as the same domains. In case you want to distinguish between these variations,
set `Subsite::$strict_subdomain_matching` to TRUE. This won't affect wildcard/asterisk checks,
but removes the ambiguity about default subdomains.
The module tries to provide sensible defaults, in which it regards `example.com` and `www.example.com` as the same domains. In case you want to distinguish between these variations, set `Subsite::$strict_subdomain_matching` to TRUE. This won't affect wildcard/asterisk checks, but removes the ambiguity about default subdomains.
### Permissions ###
Groups can be associated with one or more subsites, in which case the granted permissions
only apply to this subsite. Even the `ADMIN` permission only grants super-user rights on certain
subsites by default. If you want to create a super-user regardless of subsites association,
please use the `Group.AccessAllSubsites` property ("Give this group access to all subsites"),
together with the `ADMIN` permission.
only apply to this subsite. Even the `ADMIN` permission only grants super-user rights on certain subsites by default. If you want to create a super-user regardless of subsites association, please use the `Group.AccessAllSubsites` property ("Give this group access to all subsites"), together with the `ADMIN` permission.
### Access created domains
@ -104,6 +98,65 @@ Not all themes might be suitable or adapted for all subsites. You can optionally
:::php
Subsite::set_allowed_themes(array('blackcandy','mytheme'));
### Enable Subsite support on DataObjects
To make your DataObject subsite aware, include a SubsiteID on your DataObject. eg:
*MyDataObject.php*
:::php
private static $has_one = array(
'Subsite' => 'Subsite'
);
Include the current SubsiteID as a hidden field on getCMSFields, or updateCMSFields. eg:
*MyDataObject.php*
:::php
public function getCMSFields() {
$fields = parent::getCMSFields();
if(class_exists('Subsite')){
$fields->push(new HiddenField('SubsiteID','SubsiteID', Subsite::currentSubsiteID()));
}
return $fields;
}
To limit your admin gridfields to the current Subsite records, you can do something like this:
*MyAdmin.php*
:::php
public function getEditForm($id = null, $fields = null){
$form = parent::getEditForm($id, $fields);
$gridField = $form->Fields()->fieldByName($this->sanitiseClassName($this->modelClass));
if(class_exists('Subsite')){
$list = $gridField->getList()->filter(array('SubsiteID'=>Subsite::currentSubsiteID()));
$gridField->setList($list);
}
return $form;
}
### Enable menu support for custom areas in subsites
Custom admin areas, by default, will not show in the menu of a subsite. Not all admins are adapted for or appropriate to show within a subsite. If your admin does have subsite support, or is intentionally global, you can enable the show in menu option either by applying:
*mysite/_config.php*
:::php
MyAdmin::add_extension('SubsiteMenuExtension');
or by defining the subsiteCMSShowInMenu function in your admin:
*MyAdmin.php*
:::php
public function subsiteCMSShowInMenu(){
return true;
}
### Public display of a subsite
By default, each subsite is available to the public (= not logged-in),
@ -127,5 +180,4 @@ for all subdomains:
## Screenshots
![](docs/en/_images/subsites-module-adminscreenshot-new.png)
![](docs/en/_images/subsites-module-admindropdown.png)
![](docs/en/_images/subsites-module-adminscreenshot.png)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

View File

@ -7,4 +7,4 @@ same templates, or each use different ones.
This document assumes that you have full admin rights for your site.
1. [Setting up subsites](set_up)
1. [Working with subsites](working)
1. [Working with subsites](working_with)

View File

@ -41,36 +41,21 @@ site (ie, create, edit, view.)
Groups can have access to all sites, or to one or more specific subsites. If you have different staff in charge of each
subsite, you probably want to create a separate group for each subsite.
The dropdown in the upper left corner of the CMS indicates which subsite you are currently on. While you are in the
Security section of the CMS, the selection in the subsites dropdown defines what groups you see in the left-hand pane.
The dropdown in the upper left corner of the CMS indicates which subsite you are currently on.
![Group subsites dropdown](_images/group-subsites-dropdown.jpg)
![Group subsites dropdown](_images/subsites-dropdown.png)
The choices are:
* Groups accessing all sites
* [your main site]
* [a specific subsite]
* All groups - i.e., all above combined
Once you make a selection from the dropdown, you see the appropriate groups in the *Security* section. In the Security
section, click a group and go to its *Subsites* tab to assign the subsites to which the group has access. Click *Only
Once you make a selection from the dropdown, you see the appropriate groups in the *Security* section. In the Security section, click a group and go to its *Subsites* tab to assign the subsites to which the group has access. Click *Only
these subsites* to reveal a checklist of all available sites.
![Group subsites access](_images/group-subsites-access.jpg)
![Group subsites access](_images/group-subsites-access.png)
## Copying subsites
Duplicating subsites can be useful if you want to create several subsites based on the same general site structure. You
can set up a collection of pages, files, and images and use it as a template. When you create a new subsite, instead of
starting from scratch you can copy it all from your existing subsite. This will copy all pages, files and images from
that subsite into your new subsite.
Duplicating subsites can be useful if you want to create several subsites based on the same general site structure. You can set up a collection of pages, files, and images and use it as a template. When you create a new subsite, instead of starting from scratch you can copy it all from your existing subsite. This will copy all pages, files and images from that subsite into your new subsite.
To create a new subsite template, create a new subsite described above under "Creating subsites" but don't add any
domains. Add a name that will make it easy to see that it is a template. Select the new template from the subsites
dropdown in the upper right and create the pages and add the files and images you'd like to become part of the
To create a new subsite template, create a new subsite described above under "Creating subsites" but don't add any domains. Add a name that will make it easy to see that it is a template. Select the new template from the subsites dropdown in the upper right and create the pages and add the files and images you'd like to become part of the
template.
When you create a new subsite, you can now choose to Copy structure from your template. All your pages, files and
images will be copied over to your new subsite.
When you create a new subsite, you can now choose to Copy structure from your template. All your pages, files and images will be copied over to your new subsite.
![Group subsites dropdown](_images/copy-structure.jpg)

View File

@ -2,10 +2,9 @@
## Managing content across subsites
When you are in the *Pages* or *Files* sections of the CMS, select a subsite from the dropdown in the upper left to
display the content for that site in the site tree.
Select a subsite from the dropdown in the upper left to display the content for that site in the site tree.
![Subsites dropdown](_images/subsites-dropdown.jpg)
![Subsites dropdown](_images/subsites-dropdown.png)
## Subsites virtual pages