[development] node type without a title?

Larry Garfield larry at garfieldtech.com
Fri Sep 8 04:39:56 UTC 2006


On Thursday 07 September 2006 22:37, Steve Ringwood wrote:
> Re: " I agree that titles, whether
> explicitly specifed or whether pattern-generated, should be required
> and should be unique"
>
> 	I have to disagree, I have used the same title for different node types.
> 	There is not real reason to enforce uniqueness (it assumes how I am going
> to use title).
> 	In the case where I use the same title, it ties information together for
> the user.
>
> Steve

Even if not strictly globally unique, a human-readable identifier for a node 
is a good thing.  

I think the simplest answer would be to have a hook_node_title() or similar 
that takes either a nid or node object, and returns the human-friendly string 
for the node.  The simplest case would just return $node->title, and in fact 
that could be the default behavior of no *_node_title() is defined.  If it's 
defined, that function can return a semi-unique string based on the node 
however it likes.

Something to consider for 5.1, I suppose. :-)

-- 
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