Drupal trick: Returning a themed menu tree with nothing more than the system path

I remember something a long time teacher said, "Nick, if you make a suit out of a gorrilla, the arms are too long." I forgot why that was relevent to the topic of theming menu trees.

Moving on, here's a nice little function I wrote to return a themed menu tree by path.

// will return all menu items under "administration".
print theme('menu_tree_by_path','admin');

// will return links to all node submission forms
print theme('menu_tree_by_path','node/add');

// return the correct menu array by path
function menu_get_mid_by_path($path) {
// oddly, menu_get_item accepts a path, but returns the parent id.

Quote of the Day: Annoying, Tragic, Apple Fans

In fact, the best way for fanboys to get me to replace my BlackBerry with an iPhone is probably to stop trying. Apple's products sell themselves better than an overbearing guy in a "Geek Pride" t-shirt ever will. -Paul Boutin, Valleywag

Quote of the Day: Hugh's Second Law

"All online social networks eventually turn into a swampy mush of spam."

-Hugh Macleod [click the link for a brilliant business plan]

7 jQuery Plugins That Made Our Lives Easier at ON Networks

We, the developers of ON Networks released version 1.1 of our website this evening (its built off of drupal of course... if it weren't, than I would go sharing it with the planet, would i?). The notable improvements are ajax comments, tooltips for episodes, and a global navigation.

The real quote of the day

The other quote of the day was chic, but this quote of the day is 100X times scarier (for americanski). "When I start seeing rap stars flashing euros instead of U.S. dollars, I know our economy is in trouble." -Mark Olson

Quote of the Day

"Once you accept that mushrooms and warp zones can be punishments rather than rewards, you start to question the nature of the game and to ponder strategic gambits you would never have considered while playing the original Super Mario Bros." -Chris Suellentrop, Slate, "Super Mario Bros: The lost levels"

Code Pink On Bush's Radar

See story. Congrats to all of you.

Web 3.0 is Born

Just when web 2.0 got old and tiresome, Google announces OpenSocial. Mark my words: the internet just entered an entirely new era.

Since version 2.0, we -- the people who live and think inside the matrix -- have taken on a habit of using meaningless numbers to describe the strongest trends, and advances in internet technology. That's all the buzzword "Web 3.0" is. That's all "Web 2.0" was.

Don't get hung up on the buzzword  -- web 3.0 is in an early infancy, right now its vague enough that  that crazy historical maps like the one for web 2.0 are needed to describe it. (Tim? Come on... where is your web 3.0 map?)

WYMeditor (What You Mean is What You Get) Poised for World Dominance

Back at ON Networks, we just finished upgrading from tinyMCE* to WYMeditor to power the textareas on the backend.

WYMeditor's main concept is to leave details of the document's visual layout, and to concentrate on its structure and meaning, while trying to give the user as much comfort as possible (at least as WYSIWYG editors).

...The end-user defines content meaning, which will determine its aspect by the use of style sheets. The result is easy and quick maintenance of information.


Subscribe to Nick Lewis: The Blog RSS