How to generate Add web content URL in asset publisher widget template?

thumbnail
Jamie Sammons, modified 2 Years ago. New Member Posts: 9 Join Date: 1/13/21 Recent Posts

I have created widget template for asset publisher and now I want to create add web content URL to create link for adding a web content of my news structure.

I have created a custom URL as below but due to the p_p_id it is showing error of you dont roles to access this portlet though I have logged in as a site administrator.

<#assign addNewsURL = URL + '/~/control_panel/manage?p_p_id=com_liferay_journal_web_portlet_JournalPortlet&p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view&_com_liferay_journal_web_portlet_JournalPortlet_mvcPath=%2Fedit_article.jsp&_com_liferay_journal_web_portlet_JournalPortlet_redirect=/group${themeDisplay.getScopeGroup().getFriendlyURL()}/home&_com_liferay_journal_web_portlet_JournalPortlet_ddmStructureId=${structureId}&_com_liferay_journal_web_portlet_JournalPortlet_folderId=0&_com_liferay_journal_web_portlet_JournalPortlet_groupId=${groupId}&_com_liferay_journal_web_portlet_JournalPortlet_showSelectFolder=false&p_p_auth='+p_p_auth>

However, same URL is working fine with super admin role.

Can someone kindly suggest to generate the URL to add the web content in liferay 7.4 freemarker asset publisher widget template.

Thanks in advance..