- Posts: 13
COMMUNITY FORUM
Generic item introtext limit words
- Zdenek
- Topic Author
- Offline
- New Member
Less
More
7 years 5 months ago #158699
by Zdenek
Generic item introtext limit words was created by Zdenek
Hello,
where can I set up limit for words in generic item? When I use K2 search I want to have just a few words, same as I get in category view.
Thank you for help.
where can I set up limit for words in generic item? When I use K2 search I want to have just a few words, same as I get in category view.
Thank you for help.
Please Log in or Create an account to join the conversation.
- Zdenek
- Topic Author
- Offline
- New Member
Less
More
- Posts: 13
7 years 5 months ago #158700
by Zdenek
Replied by Zdenek on topic Generic item introtext limit words
Ok, I did this
<?php echo K2HelperUtilities::wordLimit($item->introtext, 40); ?>
Works fine.
<?php echo K2HelperUtilities::wordLimit($item->introtext, 40); ?>
Works fine.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
- Posts: 15920
7 years 5 months ago #158705
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Generic item introtext limit words
Remember to use overrides instead of editing core files getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Zdenek
- Topic Author
- Offline
- New Member
Less
More
- Posts: 13
7 years 5 months ago - 7 years 5 months ago #158721
by Zdenek
Replied by Zdenek on topic Generic item introtext limit words
Yes, I know, I would never overide core file.
I put into the html file. Is it posible in K2 to have more then one generic item layout? I would like to use one for calender date item and different one for search results.
I put into the html file. Is it posible in K2 to have more then one generic item layout? I would like to use one for calender date item and different one for search results.
Last edit: 7 years 5 months ago by Zdenek.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
- Posts: 15920
7 years 5 months ago #158729
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Generic item introtext limit words
Depending on the taskoryou can create if/ else statements and have different layouts.
JRequest::getCmd('task') == 'search'
JRequest::getCmd('task') == 'date')
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Zdenek
- Topic Author
- Offline
- New Member
Less
More
- Posts: 13
7 years 5 months ago #158746
by Zdenek
Replied by Zdenek on topic Generic item introtext limit words
Great, thanks a lot!!!
Please Log in or Create an account to join the conversation.
- Zdenek
- Topic Author
- Offline
- New Member
Less
More
- Posts: 13
7 years 5 months ago #158752
by Zdenek
Replied by Zdenek on topic Generic item introtext limit words
It works great!
Thanks Krikor.
Thanks Krikor.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
- Posts: 15920
7 years 5 months ago #158768
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Generic item introtext limit words
You 're welcome :)
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.