You can embed a widget in another widget template in Liferay by using the liferay_portlet["runtime"]
macro. Here’s an example of how you can do this:
<@liferay_portlet["runtime"]
instanceId="unique_id"
portletName="<%=innerWidgetPortletId%>"
/>
In the above code, replace <%=innerWidgetPortletId%>
with the actual portlet ID of the inner widget. For example, if you’re embedding the Sort Portlet, your code would look like this:
<@liferay_portlet["runtime"]
instanceId="search_result_sort"
portletName="com_liferay_portal_search_web_internal_sort_portlet_SortPortlet_INSTANCE_nndp_sortSelection"
/>
This will embed the Sort Portlet within your widget template. Remember to replace "search_result_sort"
and "com_liferay_portal_search_web_internal_sort_portlet_SortPortlet_INSTANCE_nndp_sortSelection"
with your actual instance ID and portlet name, respectively.