Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Liferay 7.2 CE: enable custom keys for Widget Templates
Alessandro Candini, modified 6 Years ago.
Regular Member
Posts: 130
Join Date: 10/17/15
Recent Posts
Hi, what is the portal property in Liferay 7.2 CE that enables me to define a custom key for my Widget Templates, during their creation process?
I was able to do that in 6.2, but I don't find any reference to do it in 7.2.
I've the same problem with Web Content Structures and Web Content Templates.
Thank you.
I was able to do that in 6.2, but I don't find any reference to do it in 7.2.
I've the same problem with Web Content Structures and Web Content Templates.
Thank you.
I think, you can find the checkboxes here:
Control Panel -> Configuration -> System Settings (Content and Data) -> Dynamic Data Mapping
Control Panel -> Configuration -> System Settings (Content and Data) -> Web Content -> Administration
Uncheck the autogenerate structure/template key checkboxes.
Control Panel -> Configuration -> System Settings (Content and Data) -> Dynamic Data Mapping
Control Panel -> Configuration -> System Settings (Content and Data) -> Web Content -> Administration
Uncheck the autogenerate structure/template key checkboxes.
Alessandro Candini, modified 6 Years ago.
Regular Member
Posts: 130
Join Date: 10/17/15
Recent Posts
Thank you Christoph, that's correct!
As additional info, I've exported configuration files and put them inside osgi/configs directory of my application server:
As additional info, I've exported configuration files and put them inside osgi/configs directory of my application server:
- com.liferay.dynamic.data.mapping.web.configuration.DDMWebConfiguration.config
autogenerateStructureKey="false" autogenerateTemplateKey="false" changeableDefaultLanguage="false"
- com.liferay.journal.web.configuration.JournalWebConfiguration.config
autogenerateDDMStructureKey="false" autogenerateDDMTemplateKey="false" changeableDefaultLanguage="false" defaultDisplayView="descriptive" displayViews=[ \ "icon", \ "descriptive", \ "list", \ ] journalArticleForceAutogenerateId="true" journalArticlesSearchWithIndex="true" journalBrowseByStructuresSortedByName="true" journalDDMTemplateLanguageTypes=[ \ "ftl", \ ] journalFeedForceAutogenerateId="true" maxAddMenuItems="7" showAncestorScopesByDefault="false" showFeeds="false
Alessandro Candini, modified 5 Years ago.
Regular Member
Posts: 130
Join Date: 10/17/15
Recent Posts
I've just realized that the above configuration works only for Widget Templates...for Web Content Structures and Templates does not work and keys continue to be autogenerated. Any suggestions? Thank you
Alessandro Candini, modified 5 Years ago.
Regular Member
Posts: 130
Join Date: 10/17/15
Recent Posts
I've found that the configuration is correct, but probably Liferay has a bug.
In the images attached, you can see inside red rectangles what appears in the interface with the above configuration: a not resolved language key for structures and only a label for templates: in both cases no input text fields at all to set a custom key.
I've found a workaround with a groovy script, updating the structure/template key after their creation:
and
EDIT: I've opened a related bug to this.
In the images attached, you can see inside red rectangles what appears in the interface with the above configuration: a not resolved language key for structures and only a label for templates: in both cases no input text fields at all to set a custom key.
I've found a workaround with a groovy script, updating the structure/template key after their creation:
def structureName = "EXISTENT-STRUCTURE";
def newStructureKey = "NEW-KEY"; def query = "UPDATE DDMStructure SET structureKey='"+newStructureKey+"' WHERE name like '%"+structureName+"%';";
def result = com.liferay.portal.kernel.dao.db.DBManagerUtil.getDB().runSQL(query);
and
def templateName = "EXISTENT-TEMPLATE";
def newTemplateKey = "NEW-KEY"; def query = "UPDATE DDMTemplate SET templateKey='"+newTemplateKey+"' WHERE name like '%"+templateName+"%';";
def result = com.liferay.portal.kernel.dao.db.DBManagerUtil.getDB().runSQL(query);
---EDIT: I've opened a related bug to this.
Attachments:
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™