Keyword

Hiding certain extra-fields

  • Peter Grube
  • Peter Grube's Avatar Topic Author
  • Offline
  • Elite Member
More
11 years 7 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.
Log in  or Create an account to join the conversation.

More
11 years 7 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

Please Log in or Create an account to join the conversation.

  • Peter Grube
  • Peter Grube's Avatar Topic Author
  • Offline
  • Elite Member
More
11 years 7 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.
Log in  or Create an account to join the conversation.

More
11 years 7 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.