« Return to Thread: Proposal: detach the url from the file name and provide a field just for the url component

Proposal: detach the url from the file name and provide a field just for the url component

by Bharat Mediratta :: Rate this Message:

Reply to Author | View in Thread


In the current model, the url to an item is derived from the file path.
   This is limiting, though.  Users want to be able to tune the url
separately from the filesystem.

There are three logical components here:
1) The name of the file on disk (eg: "FamilyAlbum" or "IMG_1234.JPG")

2) The title of the photo or album, which is visible in your G3 (eg
   "Family", "Bobby's First Steps")

3) The path to the file that you share in your url (eg "Family" or
   "Family/Bobbys_First_Steps")

I propose that we add a new field called the "url_component" (need a
better name.. ideas?) which has the following attributes:

A) It gets dynamically set to something reasonable when you create a new
   album, photo or movie.  For albums, we'll set it based on the title
   you enter.  For photos/movies, it'll come from the filename or the
   caption if we can extract one from EXIF/IPTC.

B) It will not change unless you change it by hand.  So if you go back
   in and modify the title or name fields, the url_component field will
   remain.

C) If you change the url_component for an album, it affects the urls of
   all of its children.

We'll probably have to add a new field to Item_Model called
relative_url_cache which tracks changes whenever you change an
url_component, and then use this when we rewrite and parse urls.

thoughts?
-Bharat

References:
- http://sourceforge.net/apps/trac/gallery/ticket/490
- http://gallery.menalto.com/node/88668

------------------------------------------------------------------------------
__[ g a l l e r y - d e v e l ]_________________________

[ list info/archive --> http://gallery.sf.net/lists.php ]
[ gallery info/FAQ/download --> http://gallery.sf.net ]

 « Return to Thread: Proposal: detach the url from the file name and provide a field just for the url component