Foros de discusión

Using custom page template as User Public/Private pages

John Unnever, modificado hace 9 años.

Using custom page template as User Public/Private pages

New Member Mensajes: 2 Fecha de incorporación: 5/06/14 Mensajes recientes
Extremely new to liferay here, but asked to build a demo site for our boss's. I created 2 custom Page Templates. One to be used for the user private pages and the user public pages. They essentially just have the social office Profile portlet on the user public page, and on the private page i've added the profile, blog, contacts portlets. What i'm trying to accomplish here is that when a user is created, their private/public pages are automatically generated using the page templates i created and they are unable to modify them. I saw that you can make some modifications to the portal-ext file as in below. I've added my direct questions to each entry below. THANK YOU FOR ANY HELP!!!!!


# Set the name of the public layout.
default.user.public.layout.name=Welcome
(IS THIS WHERE I PUT THE NAME I GAVE TO MY PAGE TEMPLATE?)

# Set the layout template id of the public layout.
default.user.public.layout.template.id=2_columns_ii
(HOW DO I KNOW WHAT THE LAYOUT TEMPLATE ID IS? I HAVE THE LAYOUT I CHOSE FOR MY PAGE TEMPLATE SET TO 1 COLUMN)

# Set the portlet ids for the columns specified in the layout template.
default.user.public.layout.column-1=82,3
default.user.public.layout.column-2=33
default.user.public.layout.column-3=
default.user.public.layout.column-4=
(WHERE DO YOU FIND THE PORTLET ID'S FOR THE PORTLETS I ADDED TO MY PAGE TEMPLATE?)

# Set the friendly url of the public layout.
default.user.public.layout.friendly.url=/home
(DOES IT MATTER THAT BOTH PRIVATE AND PUBLIC USER PAGES END WITH /home ? IT'S /web/username/home AND /user/username/home for pub / priv)

# Set the regular theme id for the public layout.
#default.user.public.layout.regular.theme.id=classic
(I'M USING SOCIAL OFFICE AS THE THEME, WHERE DO YOU FIND THE ID FOR THAT?)

# Set the regular color scheme id for the public layout.
#default.user.public.layout.regular.color.scheme.id=01
(I'M USING THE STRATA COLOR OPTION OF SOCIAL OFFICE, SEEMING THE 2ND OF THE 2 COLOR OPTIONS, WHERE WOULD THE EXACT ID FOR THAT BE?)
Arun R S Chandran, modificado hace 9 años.

RE: Using custom page template as User Public/Private pages

Regular Member Mensajes: 149 Fecha de incorporación: 12/03/13 Mensajes recientes
Did u try applying template by selecting your page using control panel?
Mikko Torri, modificado hace 9 años.

RE: Using custom page template as User Public/Private pages

Junior Member Mensajes: 25 Fecha de incorporación: 22/04/14 Mensajes recientes
Hi John

I'd suggest you create your own template (as you have already done), create a "site" for it and export it as lar and define it as the site you want to use:

Specify a LAR file that can be used to create the user public layouts. If this property is set, the previous layout properties will be ignored.
Examples:

default.user.public.layouts.lar=${liferay.home}/deploy/default_user_public.lar

This way you don't need to mind the configuration options at all.

As to the questions:
Name, I suppose so.
The template id's can be seen in the page source code when selecting the layout of the template. Not sure if they're really documented anywhere.
Portlet Id's can be found in portal-web/docroot/liferay-portlet.xml or in more readable format in portal-impl/src/Language.properties with keys starting with "javax.portlet.title." (both files in liferay source package).

Basic rule for the id's is that if you have a (radio)button where to select them, check the source code for that radiobutton in the browser to find the id.

HTH
Mikko
Jouni Latvatalo, modificado hace 9 años.

RE: Using custom page template as User Public/Private pages

New Member Mensajes: 17 Fecha de incorporación: 21/10/13 Mensajes recientes
What if the user profile page needs to be updated: lets say a new portlet is added to it. Would this lar method update the existing user profiles (desirable behaviour) or would it just affect the profiles created after the new lar has been exported and referenced in portal-ext.properties?
thumbnail
Krzysztof Gołębiowski, modificado hace 9 años.

RE: Using custom page template as User Public/Private pages

Liferay Master Mensajes: 549 Fecha de incorporación: 25/06/11 Mensajes recientes
Hello Jouni,
Setting default.user.public.layouts.lar enables user's profile creation based on specified LAR file - and nothing more than that emoticon It does not update existing users and does not link profile page to the template (even if the lar was exported from the template).

I had a similar case recently and ended up with two groovy scripts - one for removing all currently created profile pages and one for creating new ones for existing users (creating and linking with template). Additionally I had to implement a modellistener that creates user's profile just after the account was added.

Regards,
KG
Jouni Latvatalo, modificado hace 9 años.

RE: Using custom page template as User Public/Private pages

New Member Mensajes: 17 Fecha de incorporación: 21/10/13 Mensajes recientes
You wouldn't be willing to share those scripts, now would you? ;)

-J
thumbnail
Krzysztof Gołębiowski, modificado hace 9 años.

RE: Using custom page template as User Public/Private pages

Liferay Master Mensajes: 549 Fecha de incorporación: 25/06/11 Mensajes recientes
I can share them, I just need to remove all the client stuff and put it somewhere on github. I will try to do that soon. However, I've been talking about this issue at the recent DevCon's Unconference and I was told that since 6.2, exactly the same thing can be done via User Groups. I haven't tried this yet so if you will manage to get it working, you could post your experiences here.

I looked in the documentation and it really is there emoticon

Note in the figure above that a user group can have a site, with public and private pages. A user group site is a special type of site that determines the base pages of the personal sites of all the user group members. User group sites work similarly to site templates, except that user group site pages are not copied for each user. Instead, they are shown dynamically along with any custom pages that the user may have on his/her personal site.

Regards,
KG