Cannot import an individual page template
Written By
István Gergely-Tárnoki
How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!
While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.
Legacy Article
You are viewing an article from our legacy "FastTrack"
publication program, made available for informational purposes. Articles
in this program were published without a requirement for independent
editing or verification and are provided"as is" without
guarantee.
Before using any information from this article, independently verify its
suitability for your situation and project.
Issue
- We have exported a page template through the template's context menu -> Export
- When we try to import it to another page templates, it fails and throws the below error:
Please import a LAR file of the correct type (layout-prototype)
- How can we import one page template alone?
Resolution
- The error message is intended and it indicated that you're trying to import a wrong type of entity into the portlet
- Through the "Export" option of the page template's context menu, you actually export the content inside that template, not the template itself.
- The generated LAR file is therefore intended to be imported over an existing Template, and not through the Import option of the Page Templates. That's why you get the incorrect type error.
-
There are two template export methods:
- Exporting all page templates: type="portlet" root-portlet-id="com_liferay_layout_prototype_web_portlet_LayoutPrototypePortlet"
- Exporting a single page template: "type="layout-prototype"
- So when the error message says "
Please import a LAR file of the correct type (layout-prototype)", it refers to that a single template's content can't be imported in the portlet, only another single template.
- You can only export a template itself using the Date range function in the portlet's Export menu, that way you will export the portlet with only that specific template in it, then you can import it to another site's template
Did this article resolve your issue ?