- Posts: 59
COMMUNITY FORUM
Setting Character Limit for K2 Content Module
- kire timov
- Offline
- Senior Member
Less
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
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.
- kire timov
- Offline
- Senior Member
Less
More
- Posts: 59
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...
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.
- kchinnapparaj
- Offline
- New Member
Less
More
- Posts: 1
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.
- Lefteris
- Offline
- Moderator
Less
More
- Posts: 8743
12 years 3 weeks ago #82589
by Lefteris
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Lefteris on topic Re: Setting Character Limit for K2 Content Module
@kchinnapparaj
Are you using the latest version of K2? What's the issue you are facing?
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.
- Web75
- Offline
- New Member
Less
More
- Posts: 14
11 years 1 week ago #82590
by Web75
Replied by Web75 on topic Re: Setting Character Limit for K2 Content Module
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.
- Sarah
- Offline
- New Member
Less
More
- Posts: 14
10 years 10 months ago #82591
by Sarah
Replied by Sarah on topic Re: Setting Character Limit for K2 Content Module
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
- Visitor
10 years 10 months ago #82592
by Yiota
Replied by Yiota on topic Re: Setting Character Limit for K2 Content Module
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); ?>
<?php echo K2HelperUtilities::wordLimit($item->title, 30); ?>
Please Log in or Create an account to join the conversation.