Keyword

extra fields output

  • Tony Lindskog
  • Tony Lindskog's Avatar Topic Author
  • Offline
  • New Member
More
14 years 4 months ago #82960 by Tony Lindskog
extra fields output was created by Tony Lindskog
I would like to add an extra field group with 2-4 extra fields to show story highlights in a bullet form.

 

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.

More
14 years 4 months ago #82961 by Simon Wells
Replied by Simon Wells on topic extra fields output
Any part of K2 can be styled using the K2.css that is found in components/com_k2/css.

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.

More
14 years 3 months ago #82962 by Mats Arvendal
Replied by Mats Arvendal on topic extra fields output
I have another question about extra fields output:
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
Attachments:

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

More
14 years 3 months ago #82963 by Simon Wells
Replied by Simon Wells on topic extra fields output
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.

Simon
K2 Support

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

More
14 years 3 months ago #82964 by Mats Arvendal
Replied by Mats Arvendal on topic extra fields output
Thanks for your reply.

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.

More
14 years 3 months ago #82965 by Mats Arvendal
Replied by Mats Arvendal on topic extra fields output
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
Attachments:

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

More
14 years 2 months ago #82966 by Mats Arvendal
Replied by Mats Arvendal on topic extra fields output
It works with the final version of K2 2.3.
Great!

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

More
14 years 2 months ago #82967 by RJ Caroff
Replied by RJ Caroff on topic extra fields output
I downloaded vs 2.3 last week (Joomla 1.5.19), but I am having the problem with empty fields displaying. Any additional thoughts?

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.

More
13 years 11 months ago #82968 by Mats Arvendal
Replied by Mats Arvendal on topic extra fields output
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.

More
13 years 9 months ago #82969 by jamalansi
Replied by jamalansi on topic extra fields output
I managed to hide empty fields within the item.php template through checking whether the $extraField->value is empty or not; and it worked:

<?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.


Powered by Kunena Forum