Kentico CMS 7.0 Community Site Guide

Modifying templates for group pages

Modifying templates for group pages

Previous topic Next topic Mail us feedback on this topic!  

Modifying templates for group pages

Previous topic Next topic JavaScript is required for the print function Mail us feedback on this topic!  

The Groups -> Template page and its child (Pages) are the group pages template. Based on this template, group pages section for user-contributed articles is created for each group. As you may have noticed in the Creating a new group chapter, these pages are copied under the Group pages node when a group is created on-site. The Template page is renamed to the name of the new group in this case. When creating a group via the administration interface, you need to copy the pages manually, rename the Template page, change its alias and specify the path in the group creating form.


In the following example, you will learn how to add the Content rating web part to the template so that users will be able to rate the articles in the group pages sections.


1. Log in to CMS Desk (login administrator with blank password by default). Switch to the Edit -> Design tab and select Groups -> Template -> Pages from the content tree.


2. Click the Add web part (AddWebPart) icon of the zoneList web part zone and choose the Content rating -> Content rating web part.


3. In the web part properties window, set only the following property:


Show for document types: CMS.SimpleArticle


This ensures that the web part will be displayed only for the articles and not in the list. Click OK.




4. The web part is now placed on the page. Notice that when you switch to some of these pages in the Group pages section (e.g. Group pages -> American travellers -> Pages), the web part appears there too. This happens because these pages share the same page template - Community Site - Group pages. Any modifications that you make to the original page or to the copies will be reflected on all the pages using this page template.




5. If you go to the live site now, you should see the Content rating web part on all articles in all group pages sections. If you create a new group and create some article in its group pages section, the web part will appear on it too.




Further steps: You have learned how to add the Content rating web part to the group pages. This way, you can place any web part to the pages and achieve your required functionality. As you have seen, modifications made to any of the group pages are automatically reflected on all other group pages because of the shared page template. If you want to achieve different functionality on some of the group pages, you will have to switch to the Properties -> Template tab and click Clone as ad-hoc template. Changes made to a page with this cloned ad-hoc template will not be reflected on pages using the original page template.