Keyword

Generic item introtext limit words

  • Zdenek
  • Zdenek's Avatar Topic Author
  • Offline
  • New Member
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.

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

  • Zdenek
  • Zdenek's Avatar Topic Author
  • Offline
  • New Member
More
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.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 5 months ago #158705 by Krikor Boghossian
Replied by Krikor Boghossian on topic Generic item introtext limit words

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

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

  • Zdenek
  • Zdenek's Avatar Topic Author
  • Offline
  • New Member
More
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.
Last edit: 7 years 5 months ago by Zdenek.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 5 months ago #158729 by Krikor Boghossian
Replied by Krikor Boghossian on topic Generic item introtext limit words
Depending on the task
JRequest::getCmd('task') == 'search'
or
JRequest::getCmd('task') == 'date')
you can create if/ else statements and have different layouts.

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

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

  • Zdenek
  • Zdenek's Avatar Topic Author
  • Offline
  • New Member
More
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
  • Zdenek's Avatar Topic Author
  • Offline
  • New Member
More
7 years 5 months ago #158752 by Zdenek
Replied by Zdenek on topic Generic item introtext limit words
It works great!

Thanks Krikor.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 5 months ago #158768 by Krikor Boghossian
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.


Powered by Kunena Forum