Keyword

SubCategory - Limit Description text /use Intr txt

More
10 years 3 days ago #132489 by James
Hi K2 Community

I need to limit the number of words in the Subcategory Description, that gets shown on the Parent Category page or be able to insert Intro-Text for the SubCategories in 'Category View'.

At the moment the Subcategory description shows the whole lot, which is too much for the Parent Category page layout.

Please help.

Thanks in advance.

J

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

More
10 years 3 days ago #132490 by Lefteris
Hi. You will have to create a template override for this. First read getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates . Then you can limit the text using the following code:
<?php echo K2HelperUtilities::wordLimit($subCategory->description, 10); ?>

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