Legacy Knowledge Base
公開されました Jul. 2, 2025

個々のページ テンプレートをインポートできません

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.

問題

  • テンプレートのコンテキスト メニューからページ テンプレートをエクスポートしました -> エクスポート
  • 別のページ テンプレートにインポートしようとすると、失敗し、次のエラーがスローされます:
    正しいタイプ (レイアウト プロトタイプ) の LAR ファイルをインポートしてください
  • 1 つのページ テンプレートだけをインポートするにはどうすればよいですか?

Environment

  • Liferay DXP 7.0+

解決策

  • エラー メッセージは意図的なものであり、間違ったタイプのエンティティをポートレットにインポートしようとしていることを示しています
  • ページ テンプレートのコンテキスト メニューの [エクスポート] オプションを使用して、テンプレート自体ではなく、そのテンプレート内のコンテンツを実際にエクスポートします。
  • したがって、生成された LAR ファイルは、ページ テンプレートの [インポート] オプションではなく、既存のテンプレートにインポートされることを意図しています。 そのため、不正な型エラーが発生します。
    • テンプレートのエクスポート方法は 2 つあります。
      • すべてのページ テンプレートのエクスポート: type="portlet" root-portlet-id="com_liferay_layout_prototype_web_portlet_LayoutPrototypePortlet"
      • 単一ページ テンプレートのエクスポート: "type="layout-prototype"
    • そのため、「Please import a LAR file of the correct type (layout-prototype)」というエラー メッセージが表示された場合は、単一のテンプレートのコンテンツをポートレットにインポートできず、別の単一のテンプレートのみをインポートできることを示しています。
  • ポートレットの [エクスポート] メニューの [日付範囲] 機能を使用して、テンプレート自体のみをエクスポートできます。これにより、その特定のテンプレートのみを含むポートレットをエクスポートし、別のサイトのテンプレートにインポートできます。

追加情報

  • 詳細については、チェックしてください LPS-42220

Did this article resolve your issue ?

Legacy Knowledge Base