Dominik Marks 1 Year Ago - Edited Nice summary! For me the main disadvantage of site initializers is still that it is not able to create content/tempates etc. for the default "Liferay" site. So it is not possible to prepopulate a new Liferay instance with content. Therefore we still keep up with the resources importer (we wrote a custom extended version which is able to import more content types...) Please sign in to reply. Reply as... Cancel Vitaliy Koshelenko Dominik Marks 1 Year Ago - Edited Thanks! Actually, we try to avoid using the default site (especially, when there are mupliple sites in the instance). We can define a custom landing page to point to the required site, or implement a LoginPostAction for more complex logic. Please sign in to reply. Reply as... Cancel
Vitaliy Koshelenko Dominik Marks 1 Year Ago - Edited Thanks! Actually, we try to avoid using the default site (especially, when there are mupliple sites in the instance). We can define a custom landing page to point to the required site, or implement a LoginPostAction for more complex logic. Please sign in to reply. Reply as... Cancel
Benjamin Bini 1 Year Ago - Edited That is an awesome tool and this article is really interesting. But "update" support is more than necessary. In the real word we absolutely need to control at least structures and templates from version control and deploy it automatically with CI / CD. Site Initializers are not really usefull until some update feature is supported. Please consider it. Please sign in to reply. Reply as... Cancel Vitaliy Koshelenko Benjamin Bini 1 Year Ago - Edited Yea, missing "update" support is a big disadvantage, and I pointed it as #1 in my blog. But we still can use this feature during development, when there is no manualy inserted content, and we can hit the "Delete" button on a site without any fear :) I'd not say, that initializers are not really useful: we're usign this tool successfully on the current project with a bunch of pages, fragments, content, etc. - the deployment process and local env setup became much more easier, issues with environment differences are eliminated. But yeah, repeatable site re-creation is a little bit annoying. And, once we go to Production and customer starts inserting the content manually - we'll forget about this tool. On the other hand - insering PROD content programatically is not a good idea, too. Anyways, I have opened a ticker for "update" support - hope, Liferay team will take a look: https://issues.liferay.com/browse/LPS-162000 Please sign in to reply. Reply as... Cancel Vitaliy Koshelenko Benjamin Bini 5 Months Ago - Edited Update support is alraedy there, see my latest post: https://liferay.dev/blogs/-/blogs/site-initializers-update-support Please sign in to reply. Reply as... Cancel
Vitaliy Koshelenko Benjamin Bini 1 Year Ago - Edited Yea, missing "update" support is a big disadvantage, and I pointed it as #1 in my blog. But we still can use this feature during development, when there is no manualy inserted content, and we can hit the "Delete" button on a site without any fear :) I'd not say, that initializers are not really useful: we're usign this tool successfully on the current project with a bunch of pages, fragments, content, etc. - the deployment process and local env setup became much more easier, issues with environment differences are eliminated. But yeah, repeatable site re-creation is a little bit annoying. And, once we go to Production and customer starts inserting the content manually - we'll forget about this tool. On the other hand - insering PROD content programatically is not a good idea, too. Anyways, I have opened a ticker for "update" support - hope, Liferay team will take a look: https://issues.liferay.com/browse/LPS-162000 Please sign in to reply. Reply as... Cancel
Vitaliy Koshelenko Benjamin Bini 5 Months Ago - Edited Update support is alraedy there, see my latest post: https://liferay.dev/blogs/-/blogs/site-initializers-update-support Please sign in to reply. Reply as... Cancel
Luis Silva 6 Months Ago - Edited Hi, I'm trying to generate a Content Page containing a Web Content Article. I've generated de Page Template and exported successfully to my SI however, when I create the site, it comes out the Web Content Article does not show anything (actually displaying a message about the content I se no longer exist, which is false, it does exist). I think is probably becase in the page-definition.json the articleId and groupId changes every time the site is created. Any advice about how to avoid the articleId and groupId changes? Thanks in advance. Please sign in to reply. Reply as... Cancel Luis Silva Luis Silva 6 Months Ago - Edited Nevermind, the workaround is leave the assetEntryId and groupId empty. Please sign in to reply. Reply as... Cancel Vitaliy Koshelenko Luis Silva 2 Months Ago - Edited You can also use "[$GROUP_ID$]" placeholder to populate the value dynamically, sample: https://github.com/liferay/liferay-portal/blob/master/modules/apps/site-initializer/site-initializer-masterclass/src/main/resources/site-initializer/layout-page-templates/master-pages/main-1/page-definition.json#L347C1-L347C33 Please sign in to reply. Reply as... Cancel
Luis Silva Luis Silva 6 Months Ago - Edited Nevermind, the workaround is leave the assetEntryId and groupId empty. Please sign in to reply. Reply as... Cancel Vitaliy Koshelenko Luis Silva 2 Months Ago - Edited You can also use "[$GROUP_ID$]" placeholder to populate the value dynamically, sample: https://github.com/liferay/liferay-portal/blob/master/modules/apps/site-initializer/site-initializer-masterclass/src/main/resources/site-initializer/layout-page-templates/master-pages/main-1/page-definition.json#L347C1-L347C33 Please sign in to reply. Reply as... Cancel
Vitaliy Koshelenko Luis Silva 2 Months Ago - Edited You can also use "[$GROUP_ID$]" placeholder to populate the value dynamically, sample: https://github.com/liferay/liferay-portal/blob/master/modules/apps/site-initializer/site-initializer-masterclass/src/main/resources/site-initializer/layout-page-templates/master-pages/main-1/page-definition.json#L347C1-L347C33 Please sign in to reply. Reply as... Cancel
Fazal Babaria 2 Months Ago - Edited Well, Done !! vary helpful. Can you please suggest a solution for the structure and templates for the web content article? Please sign in to reply. Reply as... Cancel Vitaliy Koshelenko Fazal Babaria 2 Months Ago - Edited Thanks! As for web content structures/templates - you can follow an example from site-initializer-masterclass (https://github.com/liferay/liferay-portal/tree/master/modules/apps/site-initializer/site-initializer-masterclass/src/main/resources/site-initializer): 1) Create "ddm-structures" folder and put XML definitions for structures; 2) Create "ddm-templates" folder and a subfolder for each template with files: - ddm-template.json - metadata (name/ddmStructureKey/ddmTemplateKey); - ddm-template.ftl - the template code. Optionally, you can also create a "journal-articles" folder with pre-defined articles. Please sign in to reply. Reply as... Cancel Fazal Babaria Vitaliy Koshelenko 2 Months Ago - Edited Thanks, Vitaly !! What if we want to create a widget template for Asset Publisher Template then what would be the JSON value for it? F.E. We used the below-mentioned JSON for the menu display item. { "className": "com.liferay.portal.kernel.theme.NavItem", "ddmTemplateKey": "HEADER_NAVIGATION", "name": "Header Navigation", "resourceClassName": "com.liferay.portlet.display.template.PortletDisplayTemplate" } Then, what we want to create for Asset Publisher Template? Please sign in to reply. Reply as... Cancel Vitaliy Koshelenko Fazal Babaria 1 Month Ago - Edited If you need to define a widget template for the Asset Publisher - you need to change the className from com.liferay.portal.kernel.theme.NavItem to com.liferay.asset.kernel.model.AssetEntry The ddmTemplateKey and name should be defined as in sample above. The resourceClassName should be still "com.liferay.portlet.display.template.PortletDisplayTemplate" as it's a widget template. Please sign in to reply. Reply as... Cancel
Vitaliy Koshelenko Fazal Babaria 2 Months Ago - Edited Thanks! As for web content structures/templates - you can follow an example from site-initializer-masterclass (https://github.com/liferay/liferay-portal/tree/master/modules/apps/site-initializer/site-initializer-masterclass/src/main/resources/site-initializer): 1) Create "ddm-structures" folder and put XML definitions for structures; 2) Create "ddm-templates" folder and a subfolder for each template with files: - ddm-template.json - metadata (name/ddmStructureKey/ddmTemplateKey); - ddm-template.ftl - the template code. Optionally, you can also create a "journal-articles" folder with pre-defined articles. Please sign in to reply. Reply as... Cancel Fazal Babaria Vitaliy Koshelenko 2 Months Ago - Edited Thanks, Vitaly !! What if we want to create a widget template for Asset Publisher Template then what would be the JSON value for it? F.E. We used the below-mentioned JSON for the menu display item. { "className": "com.liferay.portal.kernel.theme.NavItem", "ddmTemplateKey": "HEADER_NAVIGATION", "name": "Header Navigation", "resourceClassName": "com.liferay.portlet.display.template.PortletDisplayTemplate" } Then, what we want to create for Asset Publisher Template? Please sign in to reply. Reply as... Cancel Vitaliy Koshelenko Fazal Babaria 1 Month Ago - Edited If you need to define a widget template for the Asset Publisher - you need to change the className from com.liferay.portal.kernel.theme.NavItem to com.liferay.asset.kernel.model.AssetEntry The ddmTemplateKey and name should be defined as in sample above. The resourceClassName should be still "com.liferay.portlet.display.template.PortletDisplayTemplate" as it's a widget template. Please sign in to reply. Reply as... Cancel
Fazal Babaria Vitaliy Koshelenko 2 Months Ago - Edited Thanks, Vitaly !! What if we want to create a widget template for Asset Publisher Template then what would be the JSON value for it? F.E. We used the below-mentioned JSON for the menu display item. { "className": "com.liferay.portal.kernel.theme.NavItem", "ddmTemplateKey": "HEADER_NAVIGATION", "name": "Header Navigation", "resourceClassName": "com.liferay.portlet.display.template.PortletDisplayTemplate" } Then, what we want to create for Asset Publisher Template? Please sign in to reply. Reply as... Cancel Vitaliy Koshelenko Fazal Babaria 1 Month Ago - Edited If you need to define a widget template for the Asset Publisher - you need to change the className from com.liferay.portal.kernel.theme.NavItem to com.liferay.asset.kernel.model.AssetEntry The ddmTemplateKey and name should be defined as in sample above. The resourceClassName should be still "com.liferay.portlet.display.template.PortletDisplayTemplate" as it's a widget template. Please sign in to reply. Reply as... Cancel
Vitaliy Koshelenko Fazal Babaria 1 Month Ago - Edited If you need to define a widget template for the Asset Publisher - you need to change the className from com.liferay.portal.kernel.theme.NavItem to com.liferay.asset.kernel.model.AssetEntry The ddmTemplateKey and name should be defined as in sample above. The resourceClassName should be still "com.liferay.portlet.display.template.PortletDisplayTemplate" as it's a widget template. Please sign in to reply. Reply as... Cancel