Hi everyone,
I am trying to hide certain extra fields in item display, I found this relatively simple way i changed the following line of code to output the the field name instead of field type, as a class thus allowing me to hide the field.
I am trying to hide certain extra fields in item display, I found this relatively simple way i changed the following line of code to output the the field name instead of field type, as a class thus allowing me to hide the field.
13 years 8 months ago #110410
If you are working in item.php in an override, you should be able to address the xtra field like this
$this->item->extraFields->EXTRAFIELDALIASHERE->name
and test it by name in the code that outputs the item without making the change you refer to
$this->item->extraFields->EXTRAFIELDALIASHERE->name
and test it by name in the code that outputs the item without making the change you refer to
Topic Author
13 years 8 months ago #110411
Thx again William,
I didn't understand exactly what you meant, I added the following to the foreach code and it works, but I would really like to know the best & most efficient method.
I didn't understand exactly what you meant, I added the following to the foreach code and it works, but I would really like to know the best & most efficient method.
13 years 8 months ago #110412
I think you got it, just do it in a template override See documentation above - templating in k2 for paths
Log in or create an account to reply.