- Posts: 4
COMMUNITY FORUM
- Forum
- K2 Community Forum
- English K2 Community
- [SOLVED] IntroText words limit not working while selecting
[SOLVED] IntroText words limit not working while selecting
- Jofeltje
-
- Offline
- New Member
Less
More
12 years 2 months ago #66745
by Jofeltje
Replied by Jofeltje on topic Re: IntroText words limit not working while selecting
Thank you so much!!!!!!!
Please Log in or Create an account to join the conversation.
- Russell English
-
- Offline
- Junior Member
Less
More
- Posts: 37
12 years 2 months ago - 12 years 2 months ago #66746
by Russell English
Replied by Russell English on topic Re: IntroText words limit not working while selecting
I was looking for a similar solution to this, but wanted to limit the category intro text (rather than the item intro text).
The solution was:
Go to your relevant template folder (in this case we'll use default):
/components/com_k2/templates/default
and open category.php
find the following:
and replace with the following:
The 30 above is the word limit. Hope this helps
The solution was:
Go to your relevant template folder (in this case we'll use default):
/components/com_k2/templates/default
and open category.php
find the following:
<?php if($this->params->get('subCatDescription')): ?>
<!-- Subcategory description -->
<?php echo $subCategory->description; ?>
<?php endif; ?>
and replace with the following:
<?php if($this->params->get('subCatDescription')): ?>
<!-- Subcategory description -->
<?php echo K2HelperUtilities::wordLimit($subCategory->description,30); ?>
<?php endif; ?>
The 30 above is the word limit. Hope this helps
Please Log in or Create an account to join the conversation.
- M@tin
-
- Offline
- New Member
Less
More
- Posts: 9
12 years 2 months ago #66747
by M@tin
Replied by M@tin on topic Re: IntroText words limit not working while selecting
It really works. Say "OM SHANTI" for Manoj.. :woohoo: :evil: :whistle: :silly: :sick:
Please Log in or Create an account to join the conversation.
- Florian Ughetto
-
- Offline
- New Member
Less
More
- Posts: 3
12 years 1 month ago #66748
by Florian Ughetto
Replied by Florian Ughetto on topic Re: IntroText words limit not working while selecting
Hello !
Ouah ! that's working like a charm ! However do you know how to don't get the world limit when you're in the normal page ?
Coz now i also have to click on read more when I should be on the normal page.
Tks a lot !
Ouah ! that's working like a charm ! However do you know how to don't get the world limit when you're in the normal page ?
Coz now i also have to click on read more when I should be on the normal page.
Tks a lot !
Please Log in or Create an account to join the conversation.
- v.v. SVA Assendelft
-
- Offline
- New Member
- Webmaster
11 years 11 months ago #66749
by v.v. SVA Assendelft
Replied by v.v. SVA Assendelft on topic Re: IntroText words limit not working while selecting
OM SHANTI
This solution works well with K2 2.6.6 !! Thnx very much Manoj!
This solution works well with K2 2.6.6 !! Thnx very much Manoj!
Please Log in or Create an account to join the conversation.
- Marius Olbert
-
- Offline
- New Member
Less
More
- Posts: 1
11 years 6 months ago - 11 years 6 months ago #66750
by Marius Olbert
Replied by Marius Olbert on topic Re: IntroText words limit not working while selecting
Thanks it also works with Joomla 3.0.3 Stable
P.S. OM SHANTI :)
P.S. OM SHANTI :)
Please Log in or Create an account to join the conversation.
- Tariq
-
- Offline
- New Member
Less
More
- Posts: 4
11 years 2 months ago #66751
by Tariq
Replied by Tariq on topic Re: [SOLVED] IntroText words limit not working while selecting
This solution work very fine for me,
My question now, Why this did not inserted by K2 developers if its really important by default?
My question now, Why this did not inserted by K2 developers if its really important by default?
Please Log in or Create an account to join the conversation.
- Syed Raza Imam Naqvi
-
- Offline
- New Member
Less
More
- Posts: 2
10 years 4 months ago #134567
by Syed Raza Imam Naqvi
Replied by Syed Raza Imam Naqvi on topic Re: IntroText words limit not working while selecting
Great Solution for the issue but I have question
I have implemented your solution but when I am trying to view any item...................item is only showing introText instead Full text. What is the solution for this?
Regards
I have implemented your solution but when I am trying to view any item...................item is only showing introText instead Full text. What is the solution for this?
Regards
Please Log in or Create an account to join the conversation.
- JoomlaWorks
-
- Offline
- Admin
Less
More
- Posts: 6227
10 years 4 months ago #134571
by JoomlaWorks
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by JoomlaWorks on topic Re: IntroText words limit not working while selecting
This solution is simply calling an internal function in K2 for enforcing a word limit to any text field output. If you want to limit your introtext, look in the category settings. No need to touch any code.
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Syed Raza Imam Naqvi
-
- Offline
- New Member
Less
More
- Posts: 2
10 years 4 months ago - 10 years 4 months ago #134589
by Syed Raza Imam Naqvi
Replied by Syed Raza Imam Naqvi on topic Re: IntroText words limit not working while selecting
I got the solution.
When we are showing items from more than 1 category K2 is not showing introText, to handle this issue Manoj has given the solution but I have modified it. Because Manoj Solution also limiting body text to introText when viewing Item.
Step 1. Open file item.php at location \components\com_k2\models\
Step 2. Find following line :
Step 3. Replace it with following :
After this hack K2 will show items from multiple categories with introText and when you will try to see single Item, K2 will show item with fullText.
When we are showing items from more than 1 category K2 is not showing introText, to handle this issue Manoj has given the solution but I have modified it. Because Manoj Solution also limiting body text to introText when viewing Item.
Step 1. Open file item.php at location \components\com_k2\models\
Step 2. Find following line :
if ($item->params->get('catItemIntroTextWordLimit') && $task == 'category')
Step 3. Replace it with following :
if ($item->params->get('catItemIntroTextWordLimit') && ($view == 'itemlist' && ($task == 'category' || $task == 'user' || $task == 'tag' || $task == 'date' || $task == 'search' || $task == 'itemlist' || $task == '' )))
After this hack K2 will show items from multiple categories with introText and when you will try to see single Item, K2 will show item with fullText.
Last edit: 10 years 4 months ago by Syed Raza Imam Naqvi.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
10 years 4 months ago #134607
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Re: IntroText words limit not working while selecting
Since this considered a hack, you need to keep backups of your edited files, and apply this patch every time you update K2.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Forum
- K2 Community Forum
- English K2 Community
- [SOLVED] IntroText words limit not working while selecting