I have created two sites in Liferay. SiteAlpha, SiteBeta. Both the sites have 3 pages each with wiki portlets in it. I have created 3 user groups. UG1, UG2 and UG3. My requirement is to create Wiki content with three scopes specific to the user groups instead of site/community specify Scope, where the same content will be shown in both the sites. How can this be achieved ?
1 Answers
Content in Liferay can have only one scope. So the answer to the exact wording of your question is: It doesn't work.
However, the underlying problem can easily be solved: Liferay's out-of-the-box navigation shows only the same site, but there's nothing that can keep you from extending the navigation and constructing it from multiple sites. This way you can have the navigation for SiteAlpha and SiteBeta also contain pages for SiteWiki - and even show the pages depending on the permissions.
An example for how to do this is this plugin by yours truly. I'll need to update it for version 6.2, but the general approach should be visible there. Of course, you can also achieve the same result by just using a theme that hard-codes the sites that it can navigate to.

- 46,930
- 8
- 59
- 90
-
Sure, thanks Olaf . I shall have a look at the plugin. But, I didn't quite get this point :- "Of course, you can also achieve the same result by just using a theme that hard-codes the sites that it can navigate to." Can you please elaborate on this ? – Kiran Kulkarni Feb 19 '14 at 11:33
-
Ok, I'll try to make it clearer: When you create a theme, you'll find that the navigation is built by a template named navigation.vm. By default this enumerates all pages in the current site. But you can also manually add any other site or page to the navigation in this file. The plugin that I've linked does this programmatically, but your theme can easily just list those pages/sites that you'd like to be there. – Olaf Kock Feb 19 '14 at 11:40
-
Olaf,Thanks for clarifying.I compiled your github code in my liferay 6.2 and used the custom navigation hook.The custom navigation hook creates new menu items in the navigation bar of the current site.Point is when I click on the navigation item,I am directed to the original site URL instead of loading the content in the current site.So,is this something like site redirect ? Also,I found out in liferay documentation that, "if sites are in same hierarchy,content can be shared within sites.i.e, a child site can access its parent content" Do you have more information on this? – Kiran Kulkarni Feb 20 '14 at 05:51
-
Sharing content between sites (and site hierarchies) is a new feature in Liferay 6.2 - yes, you can do this. The custom navigation plugin that I've mentioned just presents multiple sites *as if* they are a single site, or in a uniform navigation, without the content being actually shared. It came to life during 6.1 times and still might be useful: Even with sharing in hierarchical sites, there's only one hierarchy and your sharing requirements might be more sophisticated. Step back and think of the underlying problem: Do you need to *share* content or just *present* it in different contexts? – Olaf Kock Feb 22 '14 at 09:20