Jump to content

Sorting Images


Gazley
 Share

Recommended Posts

Hi there,

In the home page (and indeed elsewhere) of the first site I'm building, there are a range of images.

Some of the images are dedicated to a carousel, others are for different places in the home page.

I could obviously add all of the images to the "images" field. The image field type provdes Label and Description values. However, I will want to query all of images that should be used in the carousel to write out in a loop. So, this is an additional "property" to group by. I might also want to order the images in the carousel group by an integer so they appear in the correct or user-defined sequence. This is therefore another additional property.

I suppose I could create a second field based on image fieldtype called "carousel" and then I know it contains only the carousel images. However, I still want to have the ability for the end user to specify an order in the control panel.

Clearly, this could be achieved using a single image field where the images have a naming convention. However, this would be very brittle from the end user's POV.

The question boils down to best practice in this scenario? I could see this being a "repeater" use-case where the extra properties are part of the repeater item.

Before I do this, I wonder whether anyone could advise if this sounds like a good approach or, is there something I'm missing, like somehow extending the image module to include these values as I can see this being a requirement time and again.

Thanks!

--Gary

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...