Forums de discussion

Duplicating web content for several pages

thumbnail
Ouadia Gamrane, modifié il y a 9 années.

Duplicating web content for several pages

Junior Member Publications: 35 Date d'inscription: 16/01/14 Publications récentes
Hi all,
I'm using Liferay CE 6.1 ga3, I finished developing themes + structures + templates for my pages now this is my problem :
I have to create several empty pages for the writers to fill content, I'm wondering if there is any manipulation to create pages with empty web content (only structure + template specified) so to writer have just to log and and edit the content for exp :
I have 80 pages that have header + product description + footer I have to create the 3 web contents empty for every page that very exhausting.
thumbnail
Mohammad Danish, modifié il y a 9 années.

RE: Duplicating web content for several pages

Regular Member Publications: 187 Date d'inscription: 05/03/12 Publications récentes
I suppose you have to do that pro grammatically. Add a single page and then copy it down for the different pages(pro grammatically )
thumbnail
Ouadia Gamrane, modifié il y a 9 années.

RE: Duplicating web content for several pages

Junior Member Publications: 35 Date d'inscription: 16/01/14 Publications récentes
Yes this is the solution but i'm aware from the side effects. Do you have some code sample for duplicating web contents ?
thumbnail
Sven Werlen, modifié il y a 9 années.

RE: Duplicating web content for several pages

Regular Member Publications: 117 Date d'inscription: 25/02/09 Publications récentes
It's not that simple. You should create a hook with JAVA code which will:
  • Create content for each page
  • Create pages
  • Add portlet (web content display) to each page and configure it to show one webcontent


Take a look at the API documentationj
  • JournalArticleLocalServiceUtil.addArticle(...)
  • LayoutLocalServiceUtil.addLayout(...)
  • ((LayoutTypePortlet)layout.getLayoutType()).addPortletId(...)

(JournalArticle = content, Layout = page)
Mahendra Panchal, modifié il y a 9 années.

RE: Duplicating web content for several pages

New Member Publications: 21 Date d'inscription: 25/02/14 Publications récentes
you just have to add your web content display in theme file portal_norma.vm,

#set ($VOID = $velocityPortletPreferences.setValue('articleId', '17857')) /* you wcm Artcle Id
#set ($instance_id = "123abc678manplan")
$theme.runtime($my_portlet_id, "", $velocityPortletPreferences.toString())
$velocityPortletPreferences.reset()

you found wcm each page..

hope this help you.
thumbnail
Sven Werlen, modifié il y a 9 années.

RE: Duplicating web content for several pages

Regular Member Publications: 117 Date d'inscription: 25/02/09 Publications récentes
This only works if you want to have the same web content on everypage. It will confuse the users because when they will change the content, the content will be changed on all pages.