Keyword

Extra Fields

  • Christoph Schmid
  • Christoph Schmid's Avatar Topic Author
  • Offline
  • New Member
More
1 month 2 weeks ago #168999 by Christoph Schmid
Christoph Schmid created the topic: Extra Fields
Hello,

is it possible,to place an goup of extra fields anywhere in my item?
Normally they are on the bottom, but i need them direct in the middle of the item.
In some items i need more then one field group, but on different places, is this possible?

Thanks

Chris

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

  • Fotis
  • Fotis's Avatar
  • Offline
  • Administrator
  • JoomlaWorks Support Team
More
1 month 2 weeks ago #169013 by Fotis
Fotis replied the topic: Extra Fields
You can either retrieve all extra fields at the same time (in a foreach loop) or separately. You can't have more than 1 set of extra fields displayed directly in a K2 item by default. My guess is that you want to split them in small batches, so just retrieve each extra field by its alias value. How? Read below:

=== 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)


If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

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

  • Mohamed Abdelaziz
  • Mohamed Abdelaziz's Avatar
  • Offline
  • Platinum Member
  • Joomla Extensions Developer
More
1 month 1 week ago #169132 by Mohamed Abdelaziz
Mohamed Abdelaziz replied the topic: Extra Fields
Hi Christoph,
As an answer for the second question, I have developed the MEFG plugin for K2, which allow assigning multiple extra field groups to a category, so for items belonging to such category you can have more than one field group.
Here is the plugin JED page: extensions.joomla.org/extensions/extension/extension-specific/k2-extensions/multiple-extra-fields-groups-for-k2/

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

  • Christoph Schmid
  • Christoph Schmid's Avatar Topic Author
  • Offline
  • New Member
More
1 month 1 week ago #169136 by Christoph Schmid
Christoph Schmid replied the topic: Extra Fields
Hi Mohamed,

I have your extension and think ab out using this.
But is it possible, to put the extra fields into the normal text and not underneath?

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

  • Mohamed Abdelaziz
  • Mohamed Abdelaziz's Avatar
  • Offline
  • Platinum Member
  • Joomla Extensions Developer
More
1 month 6 days ago #169145 by Mohamed Abdelaziz
Mohamed Abdelaziz replied the topic: Extra Fields
Hi Christoph,
You are welcome :)
Yes it is possible, with a workaround in item.php override.
You need to insert a place-holder in the normal text where you want to display the extrafields, for example {{mefg_extrafields}}
Then, in the override of item.php replace this place-holder with the extra fields output.

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

  • Christoph Schmid
  • Christoph Schmid's Avatar Topic Author
  • Offline
  • New Member
More
1 month 5 days ago #169179 by Christoph Schmid
Christoph Schmid replied the topic: Extra Fields
Hi Mohamed,

can you explain this a little more, because my knowledge is not so big.
If I understand this right, i can use different extra fields on different positions on my page/text?

For example

Text
Extra Filed Group 1
Text
Text
Extra Field Group 3
Extra Field Group 4
Text
Extra Field Group 2
Text

Chris

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

  • Mohamed Abdelaziz
  • Mohamed Abdelaziz's Avatar
  • Offline
  • Platinum Member
  • Joomla Extensions Developer
More
1 month 5 days ago #169196 by Mohamed Abdelaziz
Mohamed Abdelaziz replied the topic: Extra Fields
Yes it is possible to do this, but it is not straightforward, please refer to this post www.joomreem.com/forum/28-bugs-and-usability-problems/1380-i-need-to-display-specific-group-extrafield

it has some code examples you can use to achieve what you want to do.

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

Moderators: william white