Fórum
Make Changes in Web Content via Velocity Template?
Christian Freihoff, modificado 10 Anos atrás.
Make Changes in Web Content via Velocity Template?
Junior Member Postagens: 36 Data de Entrada: 03/12/12 Postagens Recentes
To display Web Content i just write into my template
so it will retrieve the field named authentification that i have defined in the structure before.
No i am looking for a small tutorial or just for some tipps how i can make the shown web content editable. For example via a textfield input. What's the method to write something back to the structure defined web content field?
Thanks in advance
Authentification: $authentification.getData()
so it will retrieve the field named authentification that i have defined in the structure before.
No i am looking for a small tutorial or just for some tipps how i can make the shown web content editable. For example via a textfield input. What's the method to write something back to the structure defined web content field?
Thanks in advance
Bart Simpson, modificado 10 Anos atrás.
RE: Make Changes in Web Content via Velocity Template?
Liferay Master Postagens: 522 Data de Entrada: 29/08/11 Postagens Recentes
The key to update a field dynamically is to retreive the JournalArticle's content using
This xml can be modified / read using
From inside velocity you can access this using $saxReaderUtil
and access individual fields using something like
com.liferay.portlet.journal.model.JournalArticle.getContentByLocale
this will give the xml which contains the strucutre fields with populated data.This xml can be modified / read using
com.liferay.portal.kernel.xml.SAXReaderUtil
From inside velocity you can access this using $saxReaderUtil
and access individual fields using something like
doc.selectSingleNode("/root/dynamic-element[@name='" + fieldName + "']/dynamic-content")
where doc
can be retrieved from SAXReaderUtil
Christian Freihoff, modificado 10 Anos atrás.
RE: Make Changes in Web Content via Velocity Template?
Junior Member Postagens: 36 Data de Entrada: 03/12/12 Postagens Recentes
okay thanks,
afaik we are already using the sax reader util in java coded parts. that in can be used also in velocity, would be great.
unfortunately i am not very advanced in velocity templates for liferay, so can i find any tutorial or code example anywhere?
afaik we are already using the sax reader util in java coded parts. that in can be used also in velocity, would be great.
unfortunately i am not very advanced in velocity templates for liferay, so can i find any tutorial or code example anywhere?