split extra field groups in item display

  • robbrich
  • Topic Author
  • Offline
  • New Member
  • New Member
More
12 years 1 month ago #1377 by robbrich
hello
thank you for making this plugin. in my site I have 4 extra field groups, but when I go to the item page, they are all bunched together. is it possible to separate them by group? for example, I'd like to break it out like this with the group name showing above the extra fields:

Group 1
Field 1 Value 1
Field 2 Value 2
Field 3 Value 3

Group 2
Field 1 Value 1
Field 2 Value 2
Field 3 Value 3

Group 3
Field 1 Value 1
Field 2 Value 2
Field 3 Value 3

Group 4
Field 1 Value 1
Field 2 Value 2
Field 3 Value 3

I'm thinking this will require updating the item.php somehow, but I'm not quite sure how.

thank you in advance
robb

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

More
12 years 1 month ago #1378 by mmmaug1977
Replied by mmmaug1977 on topic split extra field groups in item display
Hello robb,

its true, you need to modify item.php to implement this request.

First, please read this tutorial, if you have not already done, to know how to use template overrides: getk2.org/documentation/tutorials/174-te...pts-of-sub-templates

then, edit the item.php file and remove the extra fields section there, then use this code to display each field one by one:
Code:
Group 1 <?php echo $this->item->extraFields->Field1Alias->name; ?> <?php echo $this->item->extraFields->Field1Alias->value; ?> <?php echo $this->item->extraFields->Field2Alias->name; ?> <?php echo $this->item->extraFields->Field2Alias->value; ?> <?php echo $this->item->extraFields->Field3Alias->name; ?> <?php echo $this->item->extraFields->Field3Alias->value; ?>

and repeat for each group, with html formatting as you like.

Hope it is clear now.

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

Powered by Kunena Forum