Keyword

2 columns for extra fields

  • Eduardo
  • Eduardo's Avatar Topic Author
  • Offline
  • Junior Member
More
12 years 3 months ago #67967 by Eduardo
2 columns for extra fields was created by Eduardo
Hello all !

If you could help me with this problem I'd be really grateful.

As the title says, I want to show the extra fields of an item with 2 columns as opposed to the default one. This is probably very simple, but for a non-coder, how should I do this?

Thanks for your time.

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

More
12 years 3 months ago #67968 by william white
Replied by william white on topic Re: 2 columns for extra fields
If you are working in the item view, you probably would go to the section where extra fields are displayed
(search for <!-- Item extra fields -->
and inside the foreach loop add the table rows and table columns to be generated as k2 loops thru the extra fields
If you are working in the category view edit category_item.php where there is a similar foreach loop
ALL of this would best be done in a K2 template (override)
See documentation - tips at the top for info on this
There is also a very good tutorial at OsTraining.com for K2 templating

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

  • Eduardo
  • Eduardo's Avatar Topic Author
  • Offline
  • Junior Member
More
12 years 3 months ago #67969 by Eduardo
Replied by Eduardo on topic Re: 2 columns for extra fields
Hi William thanks.

I'm using Joomla 2.5.4 and K2 2.5.7

My site is in beta at : www.sipi.com.sv/index.php/es/component/k2/item/148-vivero-caf%C3%A9-el-arco.html

If you check out that article, the extra fields appear where it says: Informacion Adicional
Essentially, I would like that list of 13 fields broken up into 7 on the left, 6 on the left, thus 2 columns.

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

More
11 years 6 months ago #67970 by Luciano
Replied by Luciano on topic Re: 2 columns for extra fields
Hello Mr. William, thank you for your support, but after some attempts I failed to get this work, all I get is a single column with duplicate data from extra fileds (2x same data).

Can you please help me to code this table? looks easy but not for me since I'm not a coder/programmer.. :(

thank you very much!
<?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; ?>
			
			<?php endforeach; ?>

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

More
11 years 5 months ago #67971 by Micha
Replied by Micha on topic Re: 2 columns for extra fields
Allready got an answer on this one?
I also need 2 columns on the extra fields.

Anybody? :woohoo:

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


Powered by Kunena Forum