Keyword

[SOLVED] Latest Items Intro Text : how to set word limit

  • Alter-active
  • Alter-active's Avatar Topic Author
  • Offline
  • New Member
More
9 years 3 months ago #136144 by Alter-active
Hi!

Here is my problem :

I set an Intro Text word limit in my categories, so when I use a k2 Category menu type everything works fine.

Now I'd like to set an Intro Text word limit for a latest items menu item (on my homepage)

My first idea was to set latest items menu item>Parameters >Intro Text to "Display"
From what I see, this parameter works only if I manually use "Read More" in each of my K2 items which is not what I want. What I'd like to get is an automatic intro text word limit, like I have when I use a K2 Category Menu Type.

So I checked different threads on this forum.

This is the closest I could get:
- Create a template override
- Edit latest-item.php
- Found <?php echo $this->item->introtext; ?>
- Replace it whith the following:
<?php echo K2HelperUtilities::wordLimit($this->item->introtext, 40); ?>

Works pretty well, except... videos I placed in the intro text area don't show anymore (I use All Videos plugin, insert videos right inside items using plugin tags)

Am I going the wrong way ? Any idea ?

Running Joomla 3.3.6
K2 2.7.0

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 3 months ago #136146 by Krikor Boghossian
Replied by Krikor Boghossian on topic Latest Items Intro Text : how to set word limit
The word limit will strip tags.
It is better to manually specify an introtext instead of limiting it in your overrides.

As for the video, try using the Media Tab so the item will always have a video to display, even if the tags are stripped.

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

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

  • Alter-active
  • Alter-active's Avatar Topic Author
  • Offline
  • New Member
More
9 years 3 months ago #136169 by Alter-active
Replied by Alter-active on topic Latest Items Intro Text : how to set word limit
Ok, thanks for the advice !

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 3 months ago #136184 by Krikor Boghossian
Replied by Krikor Boghossian on topic Latest Items Intro Text : how to set word limit
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.

More
9 years 2 weeks ago - 9 years 2 weeks ago #142910 by Saju
Thank you Krikor
Last edit: 9 years 2 weeks ago by Saju.

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


Powered by Kunena Forum