Querying to create on the fly galleries?

Post

Posted
Rating:
#8927 (In Topic #3017)
Avatar
Standard member
friendly is in the usergroup ‘Community saint’
I'm not so sure this question will bring any simple answer unless it is yes or no.

My website deals with the display of artwork, mainly paintings. Conventionally, I have thought of creating galleries based on things like media, size, creation date, or color. A problem is that a single painting can easily fit into multiple categories.

I realize I can create a gallery for all red, or all blue, or all yellow paintings, but if I want also to show only red painting  that are small and their media is oil paint I will have to duplicate many individual painting display pages and place them into separate galleries according to the specifics of the category.

The thought comes to mind, could a database be created that responds to a query which will select the appropriate painting display painting pages and assemble them in a (temporary) gallery created on the fly based on the query?

I'm guessing this is beyond the 'out of the box' performance of Composr… but could be done with customized programing of Composr. Any ideas?


Art and Imagination
of David L Friend

http://davidlfriend.com

  My Business Art Gallery
powered by ocPortal
Online now: No Back to the top

Post

Posted
Rating:
#8928
Avatar
Site director
Chris Graham is in the usergroup ‘Administrators’
Hi,

While multi-categorisation isn't supported by any of the core Composr content types (except News), there is a workaround.

You can add a custom image field. For example, "Color". You can then use the main_gallery_embed block along with Selectcode and Filtercode to filter on that custom field.

For example:
[block="root*" filter="Color=Blue" cache="0"]main_gallery_embed[/block]

This shows any images under (in the deep sense) the root gallery, that have a Color field with value Blue.

I just tested and this is working.

You'd set up Comcode pages with blocks like this, to solve as alternate views into the gallery system. You'd get to decide how to link these pages, e.g. via drop-down menus, structures of child pages, etc.


Become a fan of Composr on Facebook or add me as a friend. Add me on on Mastodon. Follow me on Minds (where I am most active). Support me on Patreon

Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Online now: No Back to the top

Post

Posted
Rating:
#8929
Avatar
Standard member
friendly is in the usergroup ‘Community saint’
Thanks for your quick reply! I'm not getting this but in bits and pieces.

Do you add the custom image field on the gallery page? I see how I can grab the images from an existing gallery (pull down menu)

I tried to add Blue to Metadata keywords (shot in the dark), but it wasn't recognized. So, do I go to the HTML TEMPLATES to add custom fields?

I'm fearing this is over my head, although after rereading your comment a few times I am much further ahead than I was when I asked my question. Thanks for your patience.


Art and Imagination
of David L Friend

http://davidlfriend.com

  My Business Art Gallery
powered by ocPortal
Online now: No Back to the top

Post

Posted
Rating:
Item has a rating of 5 (Liked by Chris Graham)
#8930
Avatar
Site staff
Adam Edington is in the usergroup ‘Super-moderators’
Hi David,

Meta tags/key words are great for returning a list of search results which match (be it 2005, Yellow, Dark Blue, or 10x8) and this may be good enough for what you require. There is a recent hotfix which should resolve your issue with Blue not working > 0005025: Searching title/meta tags in a Gallery category fails to populate results - Composr CMS feature tracker

Alternatively, you can add some custom fields for your images as Chris suggested. First you need to navigate to Admin Zone -> Content -> Galleries then click on the Choose custom 'image' fields option.

You could call the first field Color and use A value chosen from a list as the field Type. In the Default value text input you can add the options, like Blue|Green|Red|Yellow. Once your image entries are updated with the new meta, you could then filter results in a block (as Chris described) by creating new Comcode pages to display the different filtered views.
Online now: No Back to the top

Post

Posted
Rating:
#8931
Avatar
Standard member
friendly is in the usergroup ‘Community saint’
Thanks Adam, I will explore those suggestions!

      UPDATE: Not having fun with this. I am glad to find where you can add the custom image fields. I think I can stumble my way through that eventually.

But trying to get the main gallery embed to call for images with the particular custom image field tag isn't happening for me yet.

Last edit: by friendly



Art and Imagination
of David L Friend

http://davidlfriend.com

  My Business Art Gallery
powered by ocPortal
Online now: No Back to the top

Post

Posted
Rating:
#8933
Avatar
Site staff
Adam Edington is in the usergroup ‘Super-moderators’
Sticking to Meta tags would be easier and it would still return results with matching meta tags (with the hotfix). Plus there's a side block where you can filter to just meta tags from images.

The custom fields method Chris described was tested as working, but you cannot filter with the block example until you have created the custom fields and edited the gallery entries to include the new meta.
Online now: No Back to the top
1 guest and 0 members have just viewed this.

Statistics

Forum statistics:
  • 2,052 topics, 7,195 posts, 10,825 members
  • Our newest member is deek
Birthdays:
Back to Top