Keyword

More Options for Category View HELP!

  • Devon Bryce
  • Devon Bryce's Avatar Topic Author
  • Offline
  • New Member
More
13 years 4 weeks ago #99595 by Devon Bryce
More Options for Category View HELP! was created by Devon Bryce
I need help and don't know if this is possible.

In Category Item List View, I know I can enable the extra fields to appear under the thumbnail.

Question:

Is there away to only have certain fields displayed?

for example:

  if I have a thumbnail and the extra fields has 20 fields. I want to list numbers: 1,3,5,19 only?

 

thanks in advance,

DB

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

  • Yiota
  • Yiota's Avatar
  • Visitor
13 years 4 weeks ago #99596 by Yiota
Replied by Yiota on topic More Options for Category View HELP!
You will have to modify it manually for those specific fields to appear in the category item.

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

  • Devon Bryce
  • Devon Bryce's Avatar Topic Author
  • Offline
  • New Member
More
13 years 4 weeks ago #99597 by Devon Bryce
Replied by Devon Bryce on topic More Options for Category View HELP!
please let me know what files?

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

  • Yiota
  • Yiota's Avatar
  • Visitor
13 years 4 weeks ago #99598 by Yiota
Replied by Yiota on topic More Options for Category View HELP!
You will have to edit the category_item.php. If you are using K2 overrides then go to (templates/Your template/html/com_k2/default/category_item.php). Locate the block that calls the extrafields and replace it with something like the following:

 

<?php if($this->item->params->get('catItemExtraFields') && count($this->item->extra_fields)): ?>  <!-- Item extra fields -->  <div class="catItemExtraFields">      <h4><?php echo JText::_('K2_ADDITIONAL_INFO'); ?></h4>      <ul>        <?php foreach ($this->item->extra_fields as $key=>$extraField): ?>                        <?php if ($extraField->id==1): ?>                                <li class="<?php echo ($key%2) ? "odd" : "even"; ?> type<?php echo ucfirst($extraField->type); ?> group<?php echo $extraField->group; ?>">                    <span class="catItemExtraFieldsLabel"><?php echo $extraField->name; ?></span>                    <span class="catItemExtraFieldsValue"><?php echo $extraField->value; ?></span>                </li>            <?php elseif ($extraField->id==3): ?>                <li class="<?php echo ($key%2) ? "odd" : "even"; ?> type<?php echo ucfirst($extraField->type); ?> group<?php echo $extraField->group; ?>">                    <span class="catItemExtraFieldsLabel"><?php echo $extraField->name; ?></span>                    <span class="catItemExtraFieldsValue"><?php echo $extraField->value; ?></span>                </li>            <?php elseif ($extraField->id==5): ?>                <li class="<?php echo ($key%2) ? "odd" : "even"; ?> type<?php echo ucfirst($extraField->type); ?> group<?php echo $extraField->group; ?>">                    <span class="catItemExtraFieldsLabel"><?php echo $extraField->name; ?></span>                    <span class="catItemExtraFieldsValue"><?php echo $extraField->value; ?></span>                </li>            <?php elseif ($extraField->id==19): ?>                <li class="<?php echo ($key%2) ? "odd" : "even"; ?> type<?php echo ucfirst($extraField->type); ?> group<?php echo $extraField->group; ?>">                    <span class="catItemExtraFieldsLabel"><?php echo $extraField->name; ?></span>                    <span class="catItemExtraFieldsValue"><?php echo $extraField->value; ?></span>                </li>            <?php else: echo ''; endif; ?>                        <?php endforeach; ?>        </ul>    <div class="clr"></div>  </div><?php endif; ?>

 

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

  • Devon Bryce
  • Devon Bryce's Avatar Topic Author
  • Offline
  • New Member
More
13 years 4 weeks ago #99599 by Devon Bryce
Replied by Devon Bryce on topic More Options for Category View HELP!
Perfect....works Great! thanks very much.

DB


Yiota Ziaggou said:

You will have to edit the category_item.php. If you are using K2 overrides then go to (templates/Your template/html/com_k2/default/category_item.php). Locate the block that calls the extrafields and replace it with something like the following:

 

<?php if($this->item->params->get('catItemExtraFields') && count($this->item->extra_fields)): ?>  <!-- Item extra fields -->  <div class="catItemExtraFields">      <h4><?php echo JText::_('K2_ADDITIONAL_INFO'); ?></h4>      <ul>        <?php foreach ($this->item->extra_fields as $key=>$extraField): ?>                        <?php if ($extraField->id==1): ?>                                <li class="<?php echo ($key%2) ? "odd" : "even"; ?> type<?php echo ucfirst($extraField->type); ?> group<?php echo $extraField->group; ?>">                    <span class="catItemExtraFieldsLabel"><?php echo $extraField->name; ?></span>                    <span class="catItemExtraFieldsValue"><?php echo $extraField->value; ?></span>                </li>            <?php elseif ($extraField->id==3): ?>                <li class="<?php echo ($key%2) ? "odd" : "even"; ?> type<?php echo ucfirst($extraField->type); ?> group<?php echo $extraField->group; ?>">                    <span class="catItemExtraFieldsLabel"><?php echo $extraField->name; ?></span>                    <span class="catItemExtraFieldsValue"><?php echo $extraField->value; ?></span>                </li>            <?php elseif ($extraField->id==5): ?>                <li class="<?php echo ($key%2) ? "odd" : "even"; ?> type<?php echo ucfirst($extraField->type); ?> group<?php echo $extraField->group; ?>">                    <span class="catItemExtraFieldsLabel"><?php echo $extraField->name; ?></span>                    <span class="catItemExtraFieldsValue"><?php echo $extraField->value; ?></span>                </li>            <?php elseif ($extraField->id==19): ?>                <li class="<?php echo ($key%2) ? "odd" : "even"; ?> type<?php echo ucfirst($extraField->type); ?> group<?php echo $extraField->group; ?>">                    <span class="catItemExtraFieldsLabel"><?php echo $extraField->name; ?></span>                    <span class="catItemExtraFieldsValue"><?php echo $extraField->value; ?></span>                </li>            <?php else: echo ''; endif; ?>                        <?php endforeach; ?>        </ul>    <div class="clr"></div>  </div><?php endif; ?>

 

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


Powered by Kunena Forum