Foros de discusión

copy a page

Dallas Maverick, modificado hace 8 años.

copy a page

New Member Mensajes: 19 Fecha de incorporación: 26/03/15 Mensajes recientes
When I add a page to a site, I have the option to create it as a copy of an existing page within the same site. I'd like to copy a page that is from another site, provided that I have full view permission to that page and contents of that site. LayoutLocalServiceUtil.addLayout API call seems promising, however, I could not find an example of copying an arbitrary page. Does anyone could provide an example? Keep in mind we are essentially copying a page, not creating a new page from a page template.

Where is the source code of the current page copying functionality?
thumbnail
Bijan Vakili, modificado hace 8 años.

RE: copy a page

Expert Mensajes: 375 Fecha de incorporación: 10/03/09 Mensajes recientes
Dallas Maverick, modificado hace 8 años.

RE: copy a page

New Member Mensajes: 19 Fecha de incorporación: 26/03/15 Mensajes recientes
Thank you. It is helpful. When we copy a page, the web contents in that page are not copied. The new page still links to the original web contents. Is there a way to truely copy the page, including its web contents as well? It is similar to when we create a site from a site template, all the contents in the site templates are copied to the newly created site. I want to truely copy/clone a page from one site to another, however, I don't want to go the export/import, lar file route.
thumbnail
Meera Prince, modificado hace 8 años.

RE: copy a page

Liferay Legend Mensajes: 1111 Fecha de incorporación: 8/02/11 Mensajes recientes
Hi
Yes you have copied to other site and you have to copy web content also other site so that it will be working fine. there you might need to work more.
Better use what concept they have used to import page LAR file same you can use so that it will be good.
look at this code LayoutImporter then it will give some clue.

As for me idea like this.
Export Single layout from Site A
Import Single Layout Site B

Export single layout as some input stream and give to import single layout. you may need to write some custom methods handle it.

Regards,
Meera Prince




Regards.,
Meera Prince
thumbnail
Abhishek Suthar, modificado hace 7 años.

RE: copy a page

New Member Mensajes: 18 Fecha de incorporación: 26/06/13 Mensajes recientes
Yes,

I have found solution for this particular situation where you want the clone of the web content which doesn't change that original page web content if you change the content in web content display portlet on cloned page.

I have done it through ext,

Create a ext plugin and then copy the below file,It contains the changes which will need to copy the web content as well.Deploy this ext and clone the page again.