[development] Re: Update pathauto to Drupal 4.7

Larry Garfield larry at garfieldtech.com
Fri Feb 17 05:50:14 UTC 2006


On Thursday 16 February 2006 11:44, Bèr Kessels wrote:

> We talked about tokenised menu system. Making that system work two ways
> (path->callbacks AND url()->paths) is the route to take IMO. Storing 20.000
> blogs/My_user_name/feed is not a good idea. Storing one
> blogs/%username/feed that is parsed/cached for earh url() or so is a better
> idea. And no, I am not volunteering for this, but that fact should not rule
> me out of the -1ers for this one in core. :)

I'm not sure what was discussed in this tokenized menu system, so this may be 
what people already discussed when I wasn't looking, but what about defining 
a given menu as the "site tree" menu?  

If you have a menu: (contact, download, products (widget, cog, sprocket), 
support), then it seems logical that you'd have path aliases of:

contact
download
products
products/widget
products/cog
products/sprocket
support

For performance, the site tree menu could be compiled on edit to a simple 
associative array, and then reversed as well.  Save both to the cache (or 
variable, or whatever).  Then on page request pull out the reversed array and 
do an isset() check, and on l() pull the array out and static cache it.  
Total cost for l(): one SQL hit and n isset() calls.  That would cover a LOT 
of sites quite easily and provide a user-friendly way to avoid seeing 
node/xxx pages, which corporate sites for instance wouldn't particularly 
like.  The path table still overrides that, of course.

Set the Primary Links menu to the Site Tree menu to the only Menu_OTF menu, 
and now you're cooking.

<waits to be told that it's been thought of and rejected>

(And yes, don't even think about coding it until after 4.7...)

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