« Back

Hook with default site and page templates

Company Blogs July 13, 2010 By Sergio González Staff

Liferay 6 offers a new functionality to easily manage sites and pages by using templates. New templates can be designed in Page Templates and Site Templates sections in Control Panel. Administrators can design templates, include portlets, select layouts, look and feel, and everything you can set when creating a new page. They can also create site templates by defining pages to include when creating communities or organizations. 

When adding a new page, administrators will be able to select one of the previously created page templates. 

Adding new page template

Same when creating new communities: select the site template to use for public and private pages.

Adding new site template

Liferay 6 will be released including a hook containing examples of page and site templates that can be used out of the box when adding pages, communities or organizations. 

Default page templates included in the hook:

  1. Blog: Create, edit, and view blogs from this page. Explore topics using tags, and connect with other members that blog.
  2. Content: Create, edit, and explore content with this page. Search available content, explore related content with tags, and browse content categories.
  3. Wiki: Collaborate with members through the wiki on this page. Discover related content through tags, and navigate quickly and easily with categories.

Default site templates included in the hook:

  1. Public: contains home, blog, wiki, and forum page. A suite of social collaboration tools including blogs, polls, wiki, and message boards. 
  2. Private: contains home, calendar, documents, and images page. A place to manage your documents and images, follow your upcoming events in the calendar, search the directory or see the announcements. 

Some screenshots of the default public and private site templates... Hope you like it!

Default public site template

Default Private site template

Threaded Replies Author Date
Hey! this is very cool Sergio! Thanks a lot! Julio Camarero July 13, 2010 2:44 AM
Nice feature! Thanks for sharing! :D Juan Fernández July 13, 2010 4:21 AM
Page templates provide just the structure of... Pier Paolo Ramon July 14, 2010 5:58 AM
Hi pier! Glad you like it! Page templates are... Sergio González July 14, 2010 8:44 AM
Actually, another question come to my mind: is... Pier Paolo Ramon July 21, 2010 7:48 AM
Hi Pier, At the moment page templates cannot be... Sergio González August 12, 2010 7:24 AM
When a page is created via Manage Pages, is... Christopher Brisee August 11, 2010 1:57 PM
Hi Christopher, You can also apply a template... Sergio González August 12, 2010 7:30 AM
Hi Sergio, I am looking for a way to define... Andreas Müller February 14, 2011 7:13 AM
in the control panel, "page template" display... Lirone75 M. May 17, 2011 9:21 AM
Ok forget it : after saving the "page template"... Lirone75 M. May 17, 2011 9:23 AM

Hey! this is very cool Sergio! Thanks a lot!
Posted on 7/13/10 2:44 AM.
Nice feature!
Thanks for sharing! emoticon
Posted on 7/13/10 4:21 AM.
Page templates provide just the structure of the page, they do not control it?
I mean, if the hook is changed, will pages build on top of it change too? I think not, but I'm really curious.

Anyway, awesome development, when I'll move to 6 I'll sure use them!
Posted on 7/14/10 5:58 AM.
Hi pier! Glad you like it!
Page templates are just templates you can use to create pages, no control.
So, if you change the page template, it won't change previously created pages. It will only change new pages built with that modified template.
Posted on 7/14/10 8:44 AM in reply to Pier Paolo Ramon.
Actually, another question come to my mind:
is it possible to create page templates only for a specified group? (something like group-limits in themes development).
At this time i cannot see the code itself to look for it, also because this is a random question, not related to any project I manage now.
Posted on 7/21/10 7:48 AM.
When a page is created via Manage Pages, is there any way to apply a page template to it? It seems that this feature is only available when the Add/Page is selected from the Dock.

Would it ever be possible to apply a template to a pre-existing page (layout, for instance)? Thanks!
Posted on 8/11/10 1:57 PM.
Hi Pier,
At the moment page templates cannot be limited to a specific group. They all can be used within the whole portal.
Posted on 8/12/10 7:24 AM in reply to Pier Paolo Ramon.
Hi Christopher,
You can also apply a template via Manage Pages. Just below the text box to write the namee of the page you'll find a select box with the label "Template".

Apply a template is only possible when creating a new page. Page templates contain portlets, layouts, look&feel and type of page information, so applying a page template to an existing page is the same as deleting the page and creating a new page with the template.
Posted on 8/12/10 7:30 AM in reply to Christopher Brisee.
Hi Sergio,

I am looking for a way to define structures, page templates etc. in my own hook. I understand that is what you have done in the 7coqs-sample-hook, right? I can figure out that this is contained in the "sevencogs-hook\WEB-INF\src\resources\guest\journal\templates\single-image.xml resp. ..\structures\single-image.xml.
Unfortunately, I do not find a description of this in the 6.0 developer guide, e.g. the hooks section. Could you please point me to a description on how this has to be done in general? Compare my message on the message board: http://www.liferay.com/community/forums/-/message_boards/message/7523419
Posted on 2/14/11 7:13 AM in reply to Sergio González.
in the control panel, "page template" display just a page that allows to save a new name, description, language, active.

Is this functionality developed ? If it is, what did I miss ?
Posted on 5/17/11 9:21 AM.
Ok forget it : after saving the "page template" we can edit and add portlet to the template.
Posted on 5/17/11 9:23 AM in reply to Lirone75 M..