Keyword

Modifying the latest_items.php file?

  • Maureen Dunlap
  • Maureen Dunlap's Avatar Topic Author
  • Offline
  • New Member
More
10 years 3 months ago - 10 years 3 months ago #129151 by Maureen Dunlap
Modifying the latest_items.php file? was created by Maureen Dunlap
I have set up an override folder for com_k2.

The latest_items view is perfect for how I want to display my home page as it groups subcat with their titles followed by the items.

The only thing I need to do is add the requirement that these must be featured items.

In latest_item.php, I have modified line 25 as follows, but it's not working:
<?php if($this->item->params->get('latestItemTitle') && $this->item->featured): ?>

What am I missing?

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

  • Kannan Naidu Venugopal
  • Kannan Naidu Venugopal's Avatar
  • Offline
  • Platinum Member
  • Aham Brahmasmi
More
10 years 3 months ago #129152 by Kannan Naidu Venugopal
Replied by Kannan Naidu Venugopal on topic Re: Modifying the latest_items.php file?
I believe you just want to show only the featured items in the latest item view right ? If yes, then try this ..

Edit your latest_item.php
					
K2 Rocks \m/

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

  • Maureen Dunlap
  • Maureen Dunlap's Avatar Topic Author
  • Offline
  • New Member
More
10 years 3 months ago #129153 by Maureen Dunlap
Replied by Maureen Dunlap on topic Re: Modifying the latest_items.php file?
Thank you Kannan,

I had high hopes for your solution, but unfortunately it still doesn't work.

I even tried replacing your code with
<?php if ($this->item->featured): ?>

figuring that's how the item.php does it but still no luck.

Maureen

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

More
10 years 3 months ago #129154 by Lefteris
Replied by Lefteris on topic Re: Modifying the latest_items.php file?
Hi. This will only hide non-featured items. However it does not guarantee that the items fetched are featured. This is hard-coded at line 111 of /components/com_k2/views/latest/view.html.php and unfortunately cannot be changed.

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