Keyword

Module show only items with images

  • Kelsey Brookes
  • Kelsey Brookes's Avatar Topic Author
  • Offline
  • Elite Member
More
12 years 2 months ago #101334 by Kelsey Brookes
Module show only items with images was created by Kelsey Brookes
The K2 Content Module has a setting "Show only items with media", but 'images' aren't included in the definition of 'media' - if this setting is on and the item has an image but nothing in the media tab, the item won't show.

I've tried creating an override that only shows items with images and it works... sort of. If I ask for seven random items and it picks four that have images, three without, I'll get four images and three black spaces.

I understand the logic behind why my override behaves this way, just wondering if there's a way for it to pick seven random items, but only if they have images?

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

  • Kelsey Brookes
  • Kelsey Brookes's Avatar Topic Author
  • Offline
  • Elite Member
More
12 years 2 months ago #101335 by Kelsey Brookes
Replied by Kelsey Brookes on topic Re: Module show only items with images
No answer to this? :(

Seems like a fairly useful use-case....

I tried doing this:

Log in  or Create an account to join the conversation.

  • Kelsey Brookes
  • Kelsey Brookes's Avatar Topic Author
  • Offline
  • Elite Member
More
12 years 1 month ago #101336 by Kelsey Brookes
Replied by Kelsey Brookes on topic Re: Module show only items with images
I'm still hoping to get some help with this one.

For the moment, I've had to double up on some data entry:

I have a 'logo rotator' which shows the logos of the companies my client works with.

All of those logos are also used in the testimonials section.

But not all testimonials have logos.

So I can't simply put in a module that uses the images from the testimonials category - because it will pull in items that have no image and display nothing in that position.

So for the moment I'm uploading the logos twice.

Ideally I'd like to just upload them to testimonials and leave it at that.

Any ideas?

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

More
12 years 1 month ago #101337 by Lefteris
Replied by Lefteris on topic Re: Module show only items with images
Hi. Unfortunatelly you cannot pick only items with images. The media filter does refer to the video of the item.

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

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

  • Kelsey Brookes
  • Kelsey Brookes's Avatar Topic Author
  • Offline
  • Elite Member
More
12 years 1 month ago #101338 by Kelsey Brookes
Replied by Kelsey Brookes on topic Re: Module show only items with images
Thanks Lefteris - is there any way I can do it in the template override?

You can see I've made an attempt above, but my logic is faulty and it's still retrieving from all items.

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

More
12 years 1 month ago #101339 by Lefteris
Replied by Lefteris on topic Re: Module show only items with images
There is no other way doing this since the item image is not stored in the database.

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

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