Change the way custom fields are displayed

GK User
Tue May 02, 2017 8:26 pm
Hello,
I was wondering if you could help me in changing the way custom fields are displayed on the product details pages. A large group of items will have several custom fields assigned to them, and as it is now the list can get very long. Rather than have the details listed under the field name (original.jpg), I was hoping to have them listed along the same line like a chart (revised.jpg).

Thank you.
User avatar
Fresh Boarder

teitbite
Sun May 07, 2017 12:17 pm
I’m afraid that modifications such as this require extensive changes to the theme’s code; I do apologize but such large changes are custom work that are beyond the scope of our technical support.
User avatar
Moderator

GK User
Mon May 08, 2017 3:26 pm
OK, thanks.
I wasn't sure if it was just some CSS that I wasn't able to identify.
User avatar
Fresh Boarder

teitbite
Fri May 12, 2017 8:34 am
Hi

It's much more complicated than that. In K2's /templates/default/item.php You will see code:

Code: Select all
                  <?php if($params->get('itemExtraFields') && count($this->item->extra_fields)): ?>
                  <div class="itemExtraFields">
                           <h3><?php echo JText::_('K2_ADDITIONAL_INFO'); ?></h3>
                           <ul>
                                    <?php foreach ($this->item->extra_fields as $key=>$extraField): ?>
                                    <?php if($extraField->value != ''): ?>
                                    <li class="<?php echo ($key%2) ? "odd" : "even"; ?> type<?php echo ucfirst($extraField->type); ?> group<?php echo $extraField->group; ?>">
                                             <?php if($extraField->type == 'header'): ?>
                                             <h4 class="itemExtraFieldsHeader"><?php echo $extraField->name; ?></h4>
                                             <?php else: ?>
                                             <span class="itemExtraFieldsLabel"><?php echo $extraField->name; ?>:</span> <span class="itemExtraFieldsValue"><?php echo $extraField->value; ?></span>
                                             <?php endif; ?>
                                    </li>
                                    <?php endif; ?>
                                    <?php endforeach; ?>
                           </ul>
                  </div>
                  <?php endif; ?>


if You can look into it You will see that right now extra fields are just simply listed in 2 columns. Name of extrafield on left and its value on right. Changing it into anything else will require implementing whole bunch of code to replace such behaviour. So it's possible, but not supported on our forum, sorry.
User avatar
Moderator


cron