Keyword

Read More button showing in Related Items module

More
10 years 8 months ago #124008 by David
I am working on a project that uses K2 to control the articles, and one of the features that is important is the Related Items module.

One problem I am having is getting a Read More button to show in the Related Items shown at the bottom of an article. I can insert a Read More in the article itself, and when it shows in the Related Items module the Introtext shows exactly as it should, but no read More button.

How can I get the button to show? I have tried every combination of configuration settings within the Category and Item options but nothing shows.

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

  • Yiota
  • Yiota's Avatar
  • Visitor
10 years 8 months ago #124009 by Yiota
Is a link to your item page available so we can check it out?

Thank you.

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

More
10 years 8 months ago #124010 by David
Yes, of course. How stupid of me not to add a link. Sorry.

Here is the link :

myofficesearch.com/all-serviced-offices/item/23-trafalgar-square-northumberland-ave.html

and you can see that the two related items, or Offices Nearby as I have renamed it, do not show a Read More button.

The first of the two properties, 88 Wood Street, has a Read More inserted in the K2 Item so you see the Introtext as I want it to appear. The second property, Uxbridge Business Centre, does not have a Read More inserted so the text is cut off at the 50 word limit set in the Category settings.

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

  • Yiota
  • Yiota's Avatar
  • Visitor
10 years 8 months ago #124011 by Yiota
By default, there is no read more button available through the Related items.
You can add it yourself when the fulltext is available by adding something like this code
<?php if (!empty($item->fulltext)):?>
<div class="itemRelReadMore">
    <a href="<?php echo $item->link ?>"><span><?php echo JText::_("K2_READ_MORE"); ?></span></a>
</div>
<?php endif; ?>          

in item.php file of your K2 template overrides (read here: getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates about how overrides work).

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

More
10 years 8 months ago #124012 by David
Normally my legs start to shake when it comes to editing php (I must find the time to learn), but in this case I've managed to get it working.

Yiota, you are a star.

If I knew where you lived, I'd send over a cake.

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

  • Yiota
  • Yiota's Avatar
  • Visitor
10 years 8 months ago #124013 by Yiota
Thank you, David.
Glad I helped :)

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


Powered by Kunena Forum