Keyword

Extra Fields

  • Christoph Schmid
  • Christoph Schmid's Avatar Topic Author
  • Offline
  • New Member
More
5 years 6 months ago #168999 by Christoph Schmid
Extra Fields was created by Christoph Schmid
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.

More
5 years 6 months ago #169013 by JoomlaWorks
Replied by JoomlaWorks on 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)

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

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

  • Mohamed Abdelaziz
  • Mohamed Abdelaziz's Avatar
  • Offline
  • Platinum Member
  • Joomla Developer
More
5 years 6 months ago #169132 by Mohamed Abdelaziz
Replied by Mohamed Abdelaziz on 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/

Multiple Extra Fields Groups for K2
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My Extensions Store

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

  • Christoph Schmid
  • Christoph Schmid's Avatar Topic Author
  • Offline
  • New Member
More
5 years 6 months ago #169136 by Christoph Schmid
Replied by Christoph Schmid on 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 Developer
More
5 years 6 months ago #169145 by Mohamed Abdelaziz
Replied by Mohamed Abdelaziz on 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.

Multiple Extra Fields Groups for K2
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My Extensions Store

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

  • Christoph Schmid
  • Christoph Schmid's Avatar Topic Author
  • Offline
  • New Member
More
5 years 6 months ago #169179 by Christoph Schmid
Replied by Christoph Schmid on 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 Developer
More
5 years 6 months ago #169196 by Mohamed Abdelaziz
Replied by Mohamed Abdelaziz on 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.

Multiple Extra Fields Groups for K2
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My Extensions Store

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


Powered by Kunena Forum