Keyword

Extra filed in the Item Title

  • Iraqtech
  • Iraqtech's Avatar Topic Author
  • Offline
  • New Member
More
12 years 4 months ago #66125 by Iraqtech
Extra filed in the Item Title was created by Iraqtech
Hi all
Is there any way of showing one of the Extra fields indo with the Item title.?
I’m trying to build a Projects category in K2 and need to show the Closing date besides the Title.
"See example"
Thank you
Attachments:

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

  • Kannan Naidu Venugopal
  • Kannan Naidu Venugopal's Avatar
  • Offline
  • Platinum Member
  • Aham Brahmasmi
More
12 years 4 months ago #66126 by Kannan Naidu Venugopal
Replied by Kannan Naidu Venugopal on topic Re: Extra filed in the Item Title
Hi Iraqtech,

Do you intend to just display the title and the closing date?

K2 Rocks \m/

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

  • Iraqtech
  • Iraqtech's Avatar Topic Author
  • Offline
  • New Member
More
12 years 4 months ago #66127 by Iraqtech
Replied by Iraqtech on topic Re: Extra filed in the Item Title
Yes Kennan… you got it.
Maybe the title and the closing date beneath it.
Showing only the latest’s maybe 15 K2 items per page.
Thank you for the response.

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

  • Kannan Naidu Venugopal
  • Kannan Naidu Venugopal's Avatar
  • Offline
  • Platinum Member
  • Aham Brahmasmi
More
12 years 4 months ago - 12 years 4 months ago #66128 by Kannan Naidu Venugopal
Replied by Kannan Naidu Venugopal on topic Re: Extra filed in the Item Title
Hi Iraqtech,

You can accomplish this both in a component and also module view. You have to make use of the excellent MVC in K2 :D

For component view :
Copy the default folder from component/com_k2/templates/
Create a new folder in templates/html/ called com_k2/templates/ paste the default folder and rename it to tender
In the category - select tender from the template dopdown

For module view :
Copy the default folder from modules/mod_k2_content/tmpl/
Create a new folder in templates/html/ called mod_k2_content/ paste the default folder and rename it to tender
In the module k2_content - select tender from the sub-template dropdown

K2 Rocks \m/

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

  • Kannan Naidu Venugopal
  • Kannan Naidu Venugopal's Avatar
  • Offline
  • Platinum Member
  • Aham Brahmasmi
More
12 years 4 months ago #66129 by Kannan Naidu Venugopal
Replied by Kannan Naidu Venugopal on topic Re: Extra filed in the Item Title
Hi Iraqtech,

Some issues when i posting before, here's the rest

Create an extra field group tender and associate with the category
Create an extra field Deadline: and choose date as the type ( if you want to display the date as 15-06-2012 then choose textbox)

In the item view configurations for both the category and module, hide all and just show the title,link and extra field.

Hide the Additional Info text

Category:
Go to the templates/html/com_k2/templates/tender folder and edit the category_view.php
[code type=php-brief]
<!-- Item extra fields -->
<div class="catItemExtraFields">
<h4><?php echo JText::_('K2_ADDITIONAL_INFO'); ?></h4>
<ul>
<?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; ?>">
<span class="catItemExtraFieldsLabel"><?php echo $extraField->name; ?></span>
<span class="catItemExtraFieldsValue"><?php echo $extraField->value; ?></span>
</li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
<div class="clr"></div>
</div>
[/code]

Remove the
[code type=php-brief]<h4><?php echo JText::_('K2_ADDITIONAL_INFO'); ?></h4> line[/code]

Module:
Go to the templates/html/mod_k2_content/tender folder and edit the default.php
[code type=php-brief]
<div class="moduleItemExtraFields">
<b><?php echo JText::_('K2_ADDITIONAL_INFO'); ?></b>
<ul>
<?php foreach ($item->extra_fields as $extraField): ?>
<?php if($extraField->value): ?>
<li class="type<?php echo ucfirst($extraField->type); ?> group<?php echo $extraField->group; ?>">
<span class="moduleItemExtraFieldsLabel"><?php echo $extraField->name; ?></span>
<span class="moduleItemExtraFieldsValue"><?php echo $extraField->value; ?></span>
<div class="clr"></div>
</li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
</div>
[/code]

Remove the
[code type=php-brief]<b><?php echo JText::_('K2_ADDITIONAL_INFO'); ?></b> line[/code]

The rest just change the css positioning values and you'll have the display as my screenshot.

K2 Rocks \m/

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


Powered by Kunena Forum