Keyword

How to format captions etc on custom fields?

  • Arskin Fertrubble
  • Arskin Fertrubble's Avatar Topic Author
  • Offline
  • New Member
More
6 years 3 weeks ago #168900 by Arskin Fertrubble
How to format captions etc on custom fields? was created by Arskin Fertrubble
Total newbie with K2 here. Have set up a site and got K2 going but cannot figure out how to format the display of custom fields and their captions.

Any help?

Thanks

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

More
6 years 3 weeks ago #168916 by JoomlaWorks
Replied by JoomlaWorks on topic How to format captions etc on custom fields?
Either modify the foreach loop directly or call extra fields directly by their alias like this:

=== Call specific extra fields in K2 templates ===
So how would you directly output individual extra fields in your K2 overrides? Simple. Just do something like this (e.g. in item.php) to get the extra field name:

$this->item->extraFields->EXTRAFIELD_ALIAS_HERE->name

To get the extra field value you would simply do this:

$this->item->extraFields->EXTRAFIELD_ALIAS_HERE->value
$this->item->extraFields->EXTRAFIELD_ALIAS_HERE->rawValue (for date type only)

Simply replace EXTRAFIELD_ALIAS_HERE with the actual alias of the extra field you wish to output.

In modules, use:

$item->extraFields->EXTRAFIELD_ALIAS_HERE->value
$item->extraFields->EXTRAFIELD_ALIAS_HERE->rawValue (for date type only)

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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


Powered by Kunena Forum