Keyword

Setting Character Limit for K2 Content Module

More
13 years 11 months ago #82586 by kire timov
Replied by kire timov on topic Setting Character Limit for K2 Content Module
Ok.. that was the xml file...
now:
Create a template over ride for the Category listing (in my case)
So where it would be?
I tought in :
components/com_k2/templates/default/category_item.php but i cannot find the code:
< ?php if($params->get('itemIntroText')): ?>
< ?php echo $item->introtext; ?>
< ?php endif; ?>
please help

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

More
13 years 11 months ago #82587 by kire timov
Replied by kire timov on topic Setting Character Limit for K2 Content Module
i have found something in Root\components\com_k2\models\item.php
It's not the exact line of code but this:

if ($view=='item'){

if ($item->params->get('itemIntroText'))
$item->text.= $item->introtext;
if ($item->params->get('itemFullText'))
$item->text.= '{K2Splitter}'.$item->fulltext;
}
else {

switch($task){
case '':
case 'category':
if ($item->params->get('catItemIntroText')) $item->text.= $item->introtext;
break;

case 'user':
if ($item->params->get('userItemIntroText')) $item->text.= $item->introtext;
break;
default:
if ($item->params->get('genericItemIntroText')) $item->text.= $item->introtext;
break;
}

}



and now i am lost...

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

More
12 years 3 weeks ago #82588 by kchinnapparaj
Replied by kchinnapparaj on topic Re: Setting Character Limit for K2 Content Module
The link is not working. Can anyone help me fix the Character Limit to display in the Latest Item (k2_content) module for each article please?

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

More
12 years 3 weeks ago #82589 by Lefteris
@kchinnapparaj

Are you using the latest version of K2? What's the issue you are facing?

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

More
11 years 1 week ago #82590 by Web75
Hello, I am interested in this solution, but the discussion is a bit old and I can not find the file to download. Can you help? Thank you!

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

More
10 years 10 months ago #82591 by Sarah
how weird that there isn't an option for this after all these years.... I need it, along with 1000's of other.

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

  • Yiota
  • Yiota's Avatar
  • Visitor
10 years 10 months ago #82592 by Yiota
There is the option to set the limit for the introtext. If you need it to the title, for example you could use something like

<?php echo K2HelperUtilities::wordLimit($item->title, 30); ?>

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


Powered by Kunena Forum