[development] image node type

Larry Garfield larry at garfieldtech.com
Sat Dec 10 18:19:26 UTC 2005


And now a word from one of the little people... :-)

I have to largely agree with Ber here.  A node is a "piece of stuff to which 
we can do things".  We can organize them (taxonomy), we can restrict access 
to them (hook_per(), node_access_by_role, lots of others), what we can't 
easily do yet is link to them.  But we should leverage that existing 
organizational power as much as possible.  

Really, what is a photo gallery but a bunch of "image stuff"s categorized 
(taxonomy) in some user-defined way?  What is a music collection but a bunch 
of "audio stuff"s with extra metadata (taxonomy or tagging or whatever)?  

As I mentioned above, what's really missing is a way for nodes to relate to 
each other.  Drupal is great at collecting nodes, not so great at tying them 
together nicely.  <insert relationship module(s) here>

(What follows is me thinking aloud.  If it ends up being dumb, that's what 
I'll blame. <g>)

I think some of this needs to be pushed down into the node module itself.  For 
instance, hook_view() currently has only two "modes": teaser and not.  If a 
node could define additional view modes, then an image node could specify 
"fullsize", "thumbnail", "resize1", "handheld-optimized", or whatnot.  Then 
it could be accessed with:

node/123/fullsize
node/123/thumbnail

etc.  It would simply return the proper image, as mimetype image/whatever.  A 
textual node could link to it as <img src="node/123/thumbnail" />, and all is 
well.  That also allows all the existing permission restrictions to be 
applied.

That textual node, then, could have viewtypes of normal (default), teaser, 
print, etc.  

Problem: I'm not sure how that would work with custom paths (url_alias).  Hm, 
maybe that's not such a great idea.

<goes back to watching the busy people debate>

On Saturday 10 December 2005 02:53 am, Bèr Kessels wrote:
> This is a point of endless discussion in Drupal.
>
> In myworld a node  is a "thing" where all sorts of data meet. The node
> is nothing more then an entity to bind that data and make it a "thing".
>
> Unfortunately, in Drupal nodes are only used for content. For posts, to
> be more precisely. So over time drupaleers tend to think about a node as
> a post. Rather then the much more powerfull abstract "thing"it actually
> is.
>
>
> So, in this a file would be nothing more then a "thing" of type
> "document", "image" etc.
>
> Ber
>
> On Fri, Dec 09, 2005 at 12:43:34PM -0500, Rowan Kerr wrote:
> > A brief thought:
> > You could keep "nodes" and "files" separate...
> >
> > Where nodes are any kind of actual content that is typed into the site
> > And files are anything that is uploaded by the user
> >
> > Then you'd have node types and file types.. that could decide just
> > how to display different things.
> >
> > nodes would be stuff like: blog, page, article, book page, etc...
> > files would be stuff like: document, image, spreadsheet, movie, audio...
> >
> > Because files that are uploaded, I would not really expect should be
> > given a normal title, body, published/unpublished, etc... that nodes
> > (actual _content_) would have. Really, node's don't have a filename,
> > file size, mime type, filesystem path, etc...
> >
> > Then you get into more of a document management system where
> > things are clearly defined instead of combining content and external
> > files under one container.
> >
> > -Rowan

-- 
Larry Garfield			AIM: LOLG42
larry at garfieldtech.com		ICQ: 6817012

"If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it."  -- Thomas 
Jefferson


More information about the development mailing list