Keyword

introtext in search result / generic.php

  • Benjamin Donner
  • Benjamin Donner's Avatar Topic Author
  • Offline
  • New Member
More
9 years 7 months ago #140781 by Benjamin Donner
introtext in search result / generic.php was created by Benjamin Donner
Hi, I am trying to get a reasonable layout of the search result rendered by the template's generic.php . Most things start to fall into the right places, but I have problems generating the introtext.

I have tried adding a
<?php if($this->item->params->get('catItemIntroText')): ?>
which results in a blank screen

and echoing the introtext with

<?php echo K2HelperUtilities::wordLimit($item->introtext, 20); ?>
and
<?php echo K2HelperUtilities::wordLimit($this->item->introtext, 50); ?>
and
<?php echo $item->introtext; ?>
and
<?php echo K2HelperUtilities::wordLimit($item->introtext, 60); ?>

, none of these resulting i anything.

What am I doing wrong?

Thanks,
Ben

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 7 months ago #140800 by Krikor Boghossian
Replied by Krikor Boghossian on topic introtext in search result / generic.php
Hello Ben,

This should work in the generic.php file
<?php echo $item->introtext; ?>

but you should add the proper parameters.
<?php if($this->params->get('genericItemIntroText')): ?>

Once you have that setup you can add a word limit ( K2HelperUtilities::wordLimit)

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