Templated Groups | |
Templated Groups is a new feature in Tiki 21 that enables Organic Groups, although strictly speaking not all Templated Groups are Organic in the sense of being created by users since they can be completely admin managed. It is similar to what Workspace UI tried to achieve but is in core of Tiki rather than simply a tool to set things up over what Tiki already had. Workspace UI will need to be upgraded to support Templated Groups natively (TODO, not sure if in time for Tiki 21). Templated Groups can be used in conjunction with Roles (in many cases it makes sense to do so) but it is not strictly necessary as they are independant features. |
What are Templated Groups for? | |
Templated groups are groups that follow the same pattern as a template, such as one or more of the following:
For example:
|
Benefits of Templated Groups | |
Easy creation | |
Using the above example, say you now want to add a Geography class, it is easy to create the following and set the permissions as well.
|
Group Assets are robust to renaming of group. | |
(still work in progress as of November 2019) For example, if you made a mistake and entered "Geography" instead of "Geology" and want to rename the "Geography Class" to "Geology Class", you can just rename the group and all the assets will be renamed. Say you have 10 different wiki pages, --groupname--Handout1 to --groupname--Handout10, since --groupname-- the system will remember that you saved it like this and handle the batch renaming as needed. |
Role sub-categories are automatically managed | |
Roles provide a way to have sub-categories for each Templated Group to control permissions to access the Group Assets. For example, the following category structure is possible:
If you want to split up different types of assets into different parent categories, you can set up the following instead: (this is still not working as of Nov 2019. If you try to have more than one parent category, the new parent category will "take over" the categories of the old one, which is a bug).
|
Ability to create Templated Group Menus with smart links | |
If you need to link to other things like File Galleries, then you will need a wiki page to PluginRedirect there, or embed a plugin like PluginList to show the contents of whatever is within. For example, you can create a wiki page called "Science Class File Gallery" for that purpose. |
Example Demo | |
1. Create a Templated Group Container | |
Following the example above, first let's create the "Classes" group and make sure to set it as a Templated Group Container by checking the checkbox.
|
2. Create the Templated Groups | |
Add a "Science Class" group and "Math Class" group and make sure that you include for both of them the "Classes" Templated Group container.
|
3. Set up Groups and Roles | |
If your use case is really simple and you are not using Roles, then it is fine to add users directly to your Templated Group, e.g. Math Class. But as Templated Groups are quite limited without Roles it would be expected that you would want to setup some Roles. In that case, you would NOT want to add any users directly into the Templated Group, e.g. they are either Science Class Teachers or Science Class Students (or if both they are in both of these), which are sub-groups. Follow the example on the page Roles to set up the groups, categories and roles for Science/Math Teachers/Students. Additionally, edit all of these 4 groups to make sure they include the corresponding Templated Group:
|
4. Link Roles Category Parents to Templated Groups | |
Now go to Admin Categories and edit the settings for the Handouts category created in the Roles example. Turn on "Automatically manage sub-categories for Templated Groups Container" and set it to "Classes". The default name pattern should be changed to what you want the sub-category names to be, for example "--groupname-- Handouts" will give you something like "Science Class Handouts". Sub-categories for existing groups will automatically be created once this is turned on. In the case where you already created "Science Class Handouts" and you specify "--groupname-- Handouts", automatic management will take over the existing category.
Test Automatic Category and Roles setupTo test this, you can manually create a Geography Class by creating the Geography Class Teachers and Geography Class Students groups and then the Geography Class group. However, the order of group creation needs to be precise for the Roles to be mapped automatically to the sub-category being automatically created. Otherwise, you will have to manually set the Roles settings on the new sub-category. The correct procedure to ensure that the Roles are set automatically for the new sub-category being created is (1) First create the "Geography Class" group but do NOT include it in "Classes" yet. (2) Then create "Geography Teachers" and "Geography Students", including them in "Geography Class" as well as "Teachers"/"Students" respectively. (3) Then edit the "Geography Class" group and include it in "Classes" to trigger the sub-category creation.
Test Automatic Category RenamingAnother test you can do is to edit the Math Class group and rename it "Maths Class". Go back to categories and you will see that the category name of "Math Class Handouts" has automatically changed to "Maths Class Handouts". Test Group deletionNow delete the Geography Class group. Go back to categories and you will see that the "Geography Class Handouts" have been moved out of the "Handouts" folder, renamed to "Geography Class Handouts (Archived)" and the permissions of the category has been set to be accessible only by Admins. This is for security of whatever content was in the category before. |
6. Set up a profiles template for automatic creation of group and assets | |
It needs to be done in two sepearate profiles because of the way you need to setup the groups first and then trigger the inclusion in Classes as a separate step (as was done manually above). Data channels actually support running multiple profiles via tiki-channel.php but PluginDataChannel needs to be enhanced to do this, to simplify it to one step. Page name: createclassprofile Copy to clipboard
Copy to clipboard
Copy to clipboard
Page name: Create Class Copy to clipboard
Copy to clipboard
Copy to clipboard
Now check the groups as well as categories in the admin panels and see that they are exactly like when you did it manually, and that the Roles permissions are automatically set. Additionally, each class has 2 wiki pages created by the profile and placed in the categories already: "Biology Class Handout" and "Biology Class Assignment". |
7. Set up a listing of group assets | |
NOTE: Replace the 51 below with whatever the group ID of your group is. Copy to clipboard
|
8. Set up a group menu | |
When creating a menu option, you select the Templated Group Container under "This is a dynamic menu option for a Templated Group in:". In our example, it would be "Classes". Create 2 menu items:
Then create a module and put the menu on the left column. So what does "dynamic menu option" mean? It means:
To hide the module completely when you are not viewing any asset of the Templated Group, you can set the module settings to show only in the categories that are in the subtree of the Handouts category like this:
|
Organic Group Example | |
|