- Posts: 241
COMMUNITY FORUM
Hiding certain extra-fields
- Peter Grube
-
Topic Author
- Offline
- Elite Member
Less
More
12 years 2 months ago #110409
by Peter Grube
Hiding certain extra-fields was created by Peter Grube
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.
Log in or Create an account to join the conversation.
- william white
-
- Offline
- Platinum Member
Less
More
- Posts: 3722
12 years 2 months ago #110410
by william white
Replied by william white on topic Re: Hiding certain extra-fields
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
Please Log in or Create an account to join the conversation.
- Peter Grube
-
Topic Author
- Offline
- Elite Member
Less
More
- Posts: 241
12 years 2 months ago #110411
by Peter Grube
Replied by Peter Grube on topic Re: Hiding certain extra-fields
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.
Log in or Create an account to join the conversation.
- william white
-
- Offline
- Platinum Member
Less
More
- Posts: 3722
12 years 2 months ago #110412
by william white
Replied by william white on topic Re: Hiding certain extra-fields
I think you got it, just do it in a template override See documentation above - templating in k2 for paths
Please Log in or Create an account to join the conversation.