Widget template cannot be emeded inside the same template type.

thumbnail
Jamie Sammons, modified 1 Year ago. New Member Posts: 11 Join Date: 12/24/08 Recent Posts

If navigation widget template is embeded to another navidation template <@liferay.navigation_menu default_preferences="${preferences}" instance_id="instance1"/> the error message is displayed “The application cannot include itself.”

The issue came up with Liferay DXP 7.4.

Could this be optional, configuration, or property?

thumbnail
Olaf Kock, modified 1 Year ago. Liferay Legend Posts: 6441 Join Date: 9/23/08 Recent Posts

All I can think of is the old Xzibit meme "Yo dawg, we hear you like navigation, so we put a navigation menu into your navigation, so that you can navigate while you navigate".

But seriously: Can you describe the underlying use case more? It might have a more elegant solution than (what feels like) recursion.

thumbnail
Vladimir Vukadinovic, modified 1 Year ago. New Member Posts: 11 Join Date: 12/24/08 Recent Posts

Hi Olaf, if we exclude any pragmatic thought, this is a serious breaking change, without any resolution. We made our navigation very flexible and automatic for editors with 2 layers. Liferay can make configurable this nesting option to prevent some malusage. One if condition made us the problem to reimplement everithing from the scratch, and our customer is very angry about that.
Reproduction steps:
1.  Go to Design -> Templates -> Widget Templates and click plus to create a new one of type “Menu Display Template”
2. Set the title "New Menu Template"
3. Add the code bellow inside the FTL editor
<#assign preferences = freeMarkerPortletPreferences.getPreferences({"portletSetupPortletDecoratorId": "barebone"}) />
<@liferay.navigation_menu default_preferences="${preferences}" instance_id="instance1"/>
4.Go to Fragments > Click on plus to create new Fragment Set > Set title “New Fragment Set”
5.In the fragment set create a new fragment with name “New Fragment”
6. In the HTML editor input code <lfr-widget-nav></lfr-widget-nav>
7.Go to Home page and Edit it
8. Find newly created fragment “New Fragment” and add to page
9. Click on the configuration (three dots) and select "New Menu Template" to be displayed

Expected results:

Menu inside menu should appear

Current results:

The message “The application cannot include itself.”