We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

How To Display Images Tagged with A Specific Category Based on URL Segment

How Do I?

stereoi123's avatar
stereoi123
8 posts
5 years ago
stereoi123's avatar stereoi123

Hello,

I am hoping this can be accomplished with EE 5.3.0.

I am creating a photographers portfolio. Since the image collection is pretty large we would like to have the ability to return images based on the category assigned in the File Module.

Right now images are uploaded through a File Grid to a channel named “collections” and categories are applied to the photos in the upload dialog, or later in the File Module itself.

We would like a URL such as “domain-name.com/gallery/category_name” to display only the images tagged with that category. So a URL like “domain-name.com/gallery/water” would display only images assigned the “water” category.

I would be happy to use the category url_title if that is easier, but so far I have had no luck with either method.

Any help is greatly appreciated! If uploading example code helps, I am happy to add that.

       
Rob Allen's avatar
Rob Allen
2,950 posts
5 years ago
Rob Allen's avatar Rob Allen

I did just this a while back, the site unfortunately doesn’t exist any more so I don’t have any code to share.

Use the File module tag to output images in a category - https://docs.expressionengine.com/latest/add-ons/file.html - that should (I think) respect the /category url slug to pull in images assigned to that category. Alternatively you could use https://gotolow.com/addons/low-seg2cat to grab category ID’s.

👍 1
       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.