Keyword

Add Full Text to K2 content module

  • Concerto Designs Inc.
  • Concerto Designs Inc.'s Avatar Topic Author
  • Offline
  • Junior Member
More
10 years 10 months ago - 10 years 10 months ago #121380 by Concerto Designs Inc.
Add Full Text to K2 content module was created by Concerto Designs Inc.
I use the rich and flexible feature set of the K2 Content Module on a daily basis. The one element missing from it is the option to include the Item Full Text in addition to or instead of the Intro Text. In a recently launched site, we are using inline images in the K2 itemFullText (in order to sidestep the K2 item Image resizing). In order to display the Full Text images in a portfolio, I added this option by touching the following files (using K2 2.6.7):
mod_k2_content/helper.php

Right after the lines for including the Introtext (look for //Introtext around line 399), add:

// Fulltext

if ($params->get('itemFullText'))
{

$item->text .= $item->fulltext;
}


mod_k2_content/mod_k2_content.xml:
Right after the itemIntroText field (around line 97) add:
<field name="itemFullText" type="radio" default="1" label="K2_FULLTEXT" description="">
<option value="0">K2_HIDE</option>
<option value="1">K2_SHOW</option>
</field>

I also modified a custom subtemplate in my template html folder - if you are using the default template, open:

mod_k2_content/tmpl/Default/default.php
Look for the code that includes the itemIntroText and itemImage.
After the closing <?php endif; ?> in that sectionl, add:

<?php if($params->get('itemFullText')): ?>
<p><?php echo $item->fulltext; ?></p>
<?php endif; ?>

Keep in mind you will need to make these revisions after any upgrades unless we see this option in future releases.

In general, the K2 coding makes it really easy to customize just about anything.

Hope this might be of use - B)
Cheers!
Alan

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


Powered by Kunena Forum