- Posts: 1
COMMUNITY FORUM
extra fields output
- Tony Lindskog
-
Topic Author
- Offline
- New Member
sample: edition.cnn.com/2010/CRIME/05/11/philadelphia.cop.shot.self/index.html
On the left side, underneath the picture you have the heading "story highlights" and then 4 bullet points.
My question is; is there a way to style that output and setting it to display top left of an article automatically?
My initial test; resulted that it displayed the extra field group underneath the article and each extra fíeld name is listed first and then a "tab" and then the extra field content.
ie.
hl1 this is the first bullet point
hl2 this is the second bullet point
etc
rather than:
this is the first bullet point
this is the second bullet point
I would appreciate any help on this,
Kind Regards,
Tony
Please Log in or Create an account to join the conversation.
- Simon Wells
-
- Offline
- Platinum Member
- Posts: 955
I would recommend that you read the K2 templating guides on k2joom.com as this will explain about which files to copy and where to paste them to allow you to create a new K2 template for you to modify thus leaving the default safe.
It is possible to also move a complete block of php code that is associated with extra fields and move it to appear in a different location on the page, of course, that is a slightly different topic.
Let us know if you need any more specific information.
Simon
K2 Support
Please Log in or Create an account to join the conversation.
- Mats Arvendal
-
- Offline
- Premium Member
- Posts: 147
The header of an extra field (for example a text field) is displayed even though the content is empty. See attached file as an example (sorry for the Swedish text in the example).
Is it possible to have the header hidden when the content is empty? I need to have a sort of "optional" extra field: when content = display and no content = no display.
Rgds
Please Log in or Create an account to join the conversation.
- Simon Wells
-
- Offline
- Platinum Member
- Posts: 955
2.3 fixes that issue and svn can be obtained on getk2.org.
Remember its a beta release for testing.
Simon
K2 Support
Please Log in or Create an account to join the conversation.
- Mats Arvendal
-
- Offline
- Premium Member
- Posts: 147
I use K2 ver 2.2, and I am almost ready to launch a website online. Do you know when final v2.3 will be released?
Rgds
Please Log in or Create an account to join the conversation.
- Mats Arvendal
-
- Offline
- Premium Member
- Posts: 147
I have tested ver 2.3 on a local installtion, but the extra field still displays even though there's no value entered. See attached file. Is it possible to hide "additional fields" when empty (some articles in a category may not need extra information)
Rgds
Simon Wells (K2 Support) said:Which version of K2 are you using ?2.3 fixes that issue and svn can be obtained on getk2.org.Remember its a beta release for testing.SimonK2 Support
Please Log in or Create an account to join the conversation.
- Mats Arvendal
-
- Offline
- Premium Member
- Posts: 147
Great!
Please Log in or Create an account to join the conversation.
- RJ Caroff
-
- Offline
- New Member
- Posts: 7
Thanks!
Mats Arvendal said:Hi, I have tested ver 2.3 on a local installtion, but the extra field still displays even though there's no value entered. See attached file. Is it possible to hide "additional fields" when empty (some articles in a category may not need extra information)
Rgds
Simon Wells (K2 Support) said:Which version of K2 are you using ?2.3 fixes that issue and svn can be obtained on getk2.org.Remember its a beta release for testing.SimonK2 Support
Please Log in or Create an account to join the conversation.
- Mats Arvendal
-
- Offline
- Premium Member
- Posts: 147
After several months of delay I finally get to workm on the extra field question. And what happens? The extra field is displayed for all articles/items in a category linked to an extra field group, whether there's any content or not. This happens when I use version 2.4.1.
I have to correct myself in this matter. I thought it was solved. Anyone who knows what to do?
Rgds
Please Log in or Create an account to join the conversation.
- jamalansi
-
- Offline
- New Member
- Posts: 1
<?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(!empty($extraField->value)) : ?> <span class="itemExtraFieldsLabel"><?php echo $extraField->name; ?>:</span><span class="itemExtraFieldsValue"><?php echo $extraField->value; ?></span> <?php endif; ?> </li><?php endforeach; ?>
I hope you find it helpful.
Mats Arvendal said:
This is so odd... After several months of delay I finally get to workm on the extra field question. And what happens? The extra field is displayed for all articles/items in a category linked to an extra field group, whether there's any content or not. This happens when I use version 2.4.1. I have to correct myself in this matter. I thought it was solved. Anyone who knows what to do? Rgds
Please Log in or Create an account to join the conversation.
- Mats Arvendal
-
- Offline
- Premium Member
- Posts: 147
It looks great. I must check this out. Thanks!
Rgds
Please Log in or Create an account to join the conversation.
- Marcello
-
- Offline
- New Member
- Posts: 10
<?php echo $extraField->id[35]; ?>
Thanks in advance!
Please Log in or Create an account to join the conversation.
- william white
-
- Offline
- Platinum Member
- Posts: 3722
community.getk2.org/forum/topics/addressing-item-extra-field
Please Log in or Create an account to join the conversation.