Embedding Widgets in Templates

You can also embed widgets in web content templates. Core apps and custom apps, instanceable or non-instanceable can be embedded in web content templates. Below is an example of embedding a Language widget in FreeMarker:

<@liferay_portlet_ext["runtime"] portletName="com_liferay_portal_kernel_servlet_taglib_ui_LanguageEntry" />

In addition to embedding widgets in templates, you can embed a template within another template. This allows for reusable code, JavaScript library imports, scripts, or macros.

Below is an example of embedding a template in FreeMarker:

<#include "${templatesPath}/[template-key]" />

The Template Key can be found when editing a previously published template.

Figure 1: You can find the Template Key when view the Edit page for a template..

Figure 1: You can find the Template Key when view the Edit page for a template..

« Adding Templates with StructuresUsing Taglibs in Templates »
この記事は役に立ちましたか?
0人中0人がこの記事が役に立ったと言っています