Welcome Guest, Not a member yet? Register   Sign In
Advice on URL/controller structure and "permalinks"
#3

[eluser]jedd[/eluser]
[quote author="derekt" date="1265087142"]
I'm looking for your suggestions on MVC controller structure for a photo gallery site that will have collections of photos and multiple groups of collections, while maintaining "permalinks" for individual photos that can be in many collections.
[/quote]

You don't mention what approach you're using (schema-wise) to manage your groupings.

Quote:Thing is that a photo can be in many collections, so what would be the ideal location for a permalink? My thought was to have a separate controller for the photo detail page, at say mysite.com/photo/photo_name but the issue is then how should I tell my photo controller which collection a photo is in when users click through the next/prev links on a photo detail page?

Again, without a schema, it's hard to know what direction you're trying to take things.

Obvious choices here include having a default group for each photo (that's in multiple groups) or some algorithm for determining the better group (f.e. the one that contains more photos).

Alternatively consider that you may want URLs that contain lots of meaning - for when people send them around - that is, containing the photo ID as well as the group(s) that are being shown currently. This just means you need a more imaginative way of defining your URLs. For example site.com.au/photo/P_id/G_group1/G_group2 .. or variations.

When I wrote my gallery I was:
a) limited / defined in my direction by the backend I was using (KPhotoAlbum)
b) keen on having URLs that contained as much information as possible - I have filters, rather than groups, and I can have an arbitrary number of filters - which will define the thumbs shown. I can also be showing an image that isn't in the thumb set (it's faster to navigate around the latter, without reloading a new former all the time).

You're welcome to check my code at [url="http://dingogully.com.au/trac/phoko"]my trac site[/url] if you're interested. It's far from perfect PHP / CI / MVC, as I eschew OO and am not, by any stretch, a strong programmer. But having said that you may get some ideas you can develop upon.


Messages In This Thread
Advice on URL/controller structure and "permalinks" - by El Forum - 02-01-2010, 05:05 PM
Advice on URL/controller structure and "permalinks" - by El Forum - 02-01-2010, 06:28 PM
Advice on URL/controller structure and "permalinks" - by El Forum - 02-02-2010, 10:38 AM
Advice on URL/controller structure and "permalinks" - by El Forum - 02-03-2010, 09:27 PM
Advice on URL/controller structure and "permalinks" - by El Forum - 02-04-2010, 06:47 AM
Advice on URL/controller structure and "permalinks" - by El Forum - 02-05-2010, 12:13 PM



Theme © iAndrew 2016 - Forum software by © MyBB