-
AuthorPosts
-
July 11, 2013 at 2:55 pm #188869
Hi,
I have create one group extra fields with some fields.
In my articlesdo not need to fill in all fields..but when I preview my article I see the empty fields.
How can I solved it?
ThanksHeR0 FriendHeR0
- Join date:
- August 2011
- Posts:
- 3626
- Downloads:
- 0
- Uploads:
- 61
- Thanks:
- 33
- Thanked:
- 588 times in 549 posts
July 12, 2013 at 2:51 am #498766Hi Betty,
It depends on layout of item in the template – which is active. If you open file item.php, you could find code block to display extra field
<?php foreach ($this->item->extra_fields as $key=>$extraField): ?>
<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>
then you need to change it to
<?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; ?>
for hide extra fields which has value nullHope this helps.
Regards
1 user says Thank You to HeR0 for this useful post
July 12, 2013 at 7:41 am #498814I thank’s for you reply.
Where can I find “item.php” ?
Thank’sJuly 12, 2013 at 1:35 pm #498851I have try “item.php” on my folder template but nothing, so I have search on k2searchcomponent’s folder, but nothing..
Where can I find this file?
Thank’s so muchJuly 13, 2013 at 8:29 am #498901Can you help me?:((
HeR0 FriendHeR0
- Join date:
- August 2011
- Posts:
- 3626
- Downloads:
- 0
- Uploads:
- 61
- Thanks:
- 33
- Thanked:
- 588 times in 549 posts
July 15, 2013 at 3:57 am #498986Dear,
Sorry for late reply. In the your site, if you have not overridden k2 template, you could find item.php file in the components/com_k2/templates/default folder.
Otherwise, you find it in the templates/template_avtive_name/html/com_k2/default(the k2 active theme) folder.
Hope this clear to you.
Regards
July 15, 2013 at 3:14 pm #499067Hi
thanks for your reply. I have find the file in components/com_k2/templates/default folder. but nothing..
I can see the value null in the web site..why?July 15, 2013 at 3:52 pm #499073<em>@betty118 380810 wrote:</em><blockquote>Hi
thanks for your reply. I have find the file in components/com_k2/templates/default folder. but nothing..
I can see the value null in the web site..why?</blockquote>Ok the problem is solved.
I have wirte some text in the value null so the program can’t find the fields null
thanks the problem is solved -
AuthorPosts
This topic contains 8 replies, has 2 voices, and was last updated by betty118 11 years, 4 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum