- Posts: 3722
COMMUNITY FORUM
Hide extra field if value is empty
- william white
-
- Offline
- Platinum Member
In item php and in the hack i see < div class = itemExtraFields and in the category_item.php i see< div class = catextrafields
Please Log in or Create an account to join the conversation.
- ak2user
-
- Offline
- New Member
- Posts: 19
Yes, itemExtraFields and catItemExtraFields need to be fine tuned.
Please Log in or Create an account to join the conversation.
- anntaj
-
- Offline
- New Member
- Posts: 3
I have tired all of these suggetions and I see no change at all - what could I be doing wrong?
Thanks
Ann
Please Log in or Create an account to join the conversation.
- ak2user
-
- Offline
- New Member
- Posts: 19
Please Log in or Create an account to join the conversation.
- Visual Impact Web Design
-
- Offline
- New Member
- Posts: 12
ak2user said:Here is a reply to this question I gave on another forum and a user reported successfully implementing these instructions. The editor here strips code so I attach it as a text file:
Please Log in or Create an account to join the conversation.
- michael neese
-
- Offline
- Junior Member
- Posts: 37
I LOVE this forum.
ak2user said:Here is a reply to this question I gave on another forum and a user reported successfully implementing these instructions. The editor here strips code so I attach it as a text file:
Please Log in or Create an account to join the conversation.
- Nick
-
Topic Author
- Offline
- Elite Member
- Posts: 190
Please Log in or Create an account to join the conversation.
- Terry Britton
-
- Offline
- Elite Member
- Posts: 198
<?php $value_test = strip_tags($extraField->value); if(!empty($value_test)) : ?>
ak2user said:
Here is a reply to this question I gave on another forum and a user reported successfully implementing these instructions. The editor here strips code so I attach it as a text file:
Please Log in or Create an account to join the conversation.
- william white
-
- Offline
- Platinum Member
- Posts: 3722
Please Log in or Create an account to join the conversation.
- ak2user
-
- Offline
- New Member
- Posts: 19
Please Log in or Create an account to join the conversation.
- Next Wave, Inc.
-
- Offline
- Junior Member
- Posts: 30
I am also looking to confirm the location of the files to be edited, specifically in a Joomlart template.
Thanks!
Please Log in or Create an account to join the conversation.
- william white
-
- Offline
- Platinum Member
- Posts: 3722
You an edit them directly in the k2 core (you should find them in components/com_k2/templates/default
a Better way would be to first check to see if your template is overriding k2 templates from the start. Look in Your Site Root/Templates/Your template Name/html/com_k2/templates to see if there is anything there. If they are there edit the files there or create a new k2 template and use it. See here for more info about templating
Ken Lyle said:
Could someone please re-aggregate the status and implementation of this hack for K2 2.4.1, because the last version reference I see is Olivier's mention of 2.3.
I am also looking to confirm the location of the files to be edited, specifically in a Joomlart template.
Thanks!
Please Log in or Create an account to join the conversation.
- Next Wave, Inc.
-
- Offline
- Junior Member
- Posts: 30
Please Log in or Create an account to join the conversation.
- Next Wave, Inc.
-
- Offline
- Junior Member
- Posts: 30
Attached is the patch, including the test mentioned on page 3 of this thread, for suppressing empty textarea fields as well.
Thanks and credit to everyone who contributed.
Please Log in or Create an account to join the conversation.
- pihasurfer
-
- Offline
- New Member
- Posts: 2
I'm trying to get this work with the K2tabber plugin and I'm having some trouble. Any idea how to incorporate the hack from the previous page into this code?
<!-- ExtraField "Tabbed" by K2Tabber --> <?php if($this->item->params->get('itemExtraFields') && count($this->item->extra_fields)): ?> <!-- Item extra fields --> <br /> <div id="ExtraFields"> <h3><?php echo JText::_('Additional Info'); ?></h3> <!-- Tabs start here --> <div class="simpleTabs"> <!-- Tabs Menu --> <ul class="simpleTabsNavigation"> <?php foreach ($this->item->extra_fields as $key=>$extraField):?> <li id="<?php echo $extraField->name; ?>"><a href="javascript: void();"><?php echo $extraField->name; ?></a></li> <?php endforeach; ?> </ul> <!-- Tabs Content --> <?php foreach ($this->item->extra_fields as $key=>$extraField):?> <!-- Tab --> <div class="simpleTabsContent"><?php echo $extraField->value; ?></div> <?php endforeach; ?> </div> <!-- Tabs end here --> </div> <?php endif; ?>
Please Log in or Create an account to join the conversation.
- Russell English
-
- Offline
- Junior Member
- Posts: 37
Please Log in or Create an account to join the conversation.
- dompl
-
- Offline
- New Member
- Posts: 6
Please Log in or Create an account to join the conversation.
- Peter Monti
-
- Offline
- New Member
- Posts: 7
Please Log in or Create an account to join the conversation.
- Nick
-
Topic Author
- Offline
- Elite Member
- Posts: 190
Please Log in or Create an account to join the conversation.
- Peter Monti
-
- Offline
- New Member
- Posts: 7
Please Log in or Create an account to join the conversation.