I wanted to create a tag like:
#{some_tag entity:user, field:'name'}
and expect it to produce some output with the user name in it by using expression like:
${_entity._field}
I know it doesn’t work but that’s why I ask here.
Is there a simple way to use a field name passed as a parameter to a template tag to get the field value?
I am not aware of an easy answer, but it is possible. You can create a fast tag, and use reflection to get the field you are after.
You can get more info on Fast Tags here – Can someone explain how to use FastTags
However, wouldnt it be easier to just send the specific field through to your tag?