Keyword

Limiting search result text

  • siamnaulak
  • siamnaulak's Avatar Topic Author
  • Offline
  • Senior Member
More
7 years 11 months ago #153908 by siamnaulak
Limiting search result text was created by siamnaulak
Hi

K2 search result show the full article/item by default. Is there a way to limit the text with Read more?

We can limit introtext when using multiple categories by hacking a small code in category_item.php as show below...

<?php echo $this->item->introtext; ?>
TO
<?php echo K2HelperUtilities::wordLimit($this->item->introtext, 15); ?>

Like the above, can I limit search result in generic.php? If yes, what will be the replacement code?

Thanks

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 11 months ago #153911 by Krikor Boghossian
Replied by Krikor Boghossian on topic Limiting search result text
Remember to use overrides :)
getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates

As for the code, instead of $this->item simply use $item

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

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

  • siamnaulak
  • siamnaulak's Avatar Topic Author
  • Offline
  • Senior Member
More
7 years 11 months ago #153912 by siamnaulak
Replied by siamnaulak on topic Limiting search result text
Thank you so much Krikor, working perfectly....

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 11 months ago #153933 by Krikor Boghossian
Replied by Krikor Boghossian on topic Limiting search result text
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