Fórumok
Site custom field
Juraj Krahulec, módosítva 9 év-val korábban
Site custom field
New Member Bejegyzések: 4 Csatlakozás dátuma: 2014.05.20. Legújabb bejegyzések
Hi all,
in Liferay 6.1 I set custom field defined for Site. I want get this value in theme. I found this code to get the value:
site.getExpandoBridge().getAttribute("attirbute-key")
But this code do not work for me.
Thanks for any help.
in Liferay 6.1 I set custom field defined for Site. I want get this value in theme. I found this code to get the value:
site.getExpandoBridge().getAttribute("attirbute-key")
But this code do not work for me.
Thanks for any help.
Pankaj Kathiriya, módosítva 9 év-val korábban
RE: Site custom field
Liferay Master Bejegyzések: 722 Csatlakozás dátuma: 2010.08.05. Legújabb bejegyzések
can you provide proper code here ?
Is site here, object of Group?
Is site here, object of Group?
Juraj Krahulec, módosítva 9 év-val korábban
RE: Site custom field
New Member Bejegyzések: 4 Csatlakozás dátuma: 2014.05.20. Legújabb bejegyzések
Thank you for your reply.
Yes, site is object of Group.
I have one Portal and 8 Sites. Each site have set up custom field - version. And this value I need get to the theme(portal-normal.vm).
Yes, site is object of Group.
I have one Portal and 8 Sites. Each site have set up custom field - version. And this value I need get to the theme(portal-normal.vm).
Stan X, módosítva 8 év-val korábban
RE: Site custom field
Regular Member Bejegyzések: 208 Csatlakozás dátuma: 2008.01.28. Legújabb bejegyzések
Were you able to get this to work? I am trying it on 6.2, but it does not work.
Mark Fitzgerald, módosítva 8 év-val korábban
RE: Site custom field
Regular Member Bejegyzések: 108 Csatlakozás dátuma: 2010.10.15. Legújabb bejegyzések
Stan,
Can you post your code here? I'm using this in my portal_normal.vm template and it's working fine.
Can you post your code here? I'm using this in my portal_normal.vm template and it's working fine.
#set ($attributeValues = $group.getExpandoBridge().getAttribute("<attribute-to-get>"))
#if ($attributeValues.get(0) == "<value-to-compare>")
## Do task here
#end</value-to-compare></attribute-to-get>
Arun Das, módosítva 8 év-val korábban
RE: Site custom field
Regular Member Bejegyzések: 166 Csatlakozás dátuma: 2012.07.23. Legújabb bejegyzések
Hi,
Try this $layout.getGroup().getExpandoBridge().getAttribute("attirbute-key"); . A list of access objects from velocity is sited here
Arun
Try this $layout.getGroup().getExpandoBridge().getAttribute("attirbute-key"); . A list of access objects from velocity is sited here
Arun
Stan X, módosítva 8 év-val korábban
RE: Site custom field
Regular Member Bejegyzések: 208 Csatlakozás dátuma: 2008.01.28. Legújabb bejegyzések
Thanks for the responses.
The following worked for me:
The following worked for me:
#set ($cfield = $layout.getGroup().getExpandoBridge().getAttribute("customfield"))