How to access custom page fields in a theme template
I would like to use custom fields to display some strings in a topic.
I created a custom "intro" field of type Textbox.
How do I access the data in the theme template (speed)?
Since there is no "introspection" that variables declare, it is very difficult for me to figure out how to get them. The documentation is far from being used on the topic of custom fields: - /
+3
source to share
3 answers
Work with me at Liferay 7+:
Create a custom field type "site", fill in the data in the site settings and use the theme in the template to call this data into the liferay theme:
If the VM file:
#set ($site_custom_field = $layout.getGroup().getExpandoBridge().getAttribute("site_custom_field_key"))
<h1>$site_custom_field</h1>
If the file is FTL:
<#assign site_custom_field = layout.getGroup().getExpandoBridge().getAttribute("site_custom_field_key")>
<h1>${site_custom_field}</h1>
Have a nice day!
+1
source to share