Forums / Setup & design / Accessing attributes by name in $content_attributes

Accessing attributes by name in $content_attributes

Author Message

Hakim Bouras

Thursday 29 November 2007 9:32:45 am

Hi,

I would like to personalize "edit" templates, and for this I do not want to loop through $content_attributes as it is usually done.

How can I access an attribute <b>using its name</b> ?

I already tried to access it through $object.current.data_map.<attribute_name> but this way, when there is an error in the validation of the form, the fields that were initially filled before submitting the form are empty.

Do you have any idea to avoid a hard coded solution such as:

set $my_name=$content_attributes[0]
set $my_user_account=$content_attributes[1]
set $my_address=$content_attributes[2]
(...)

Thank you for your help,
Hakim