Let’s try this again.
A subject for another blog, I’ve been asked to help a local small retailer join the eCommerce revolution. The owner has finally decided that he needs to be online or he faces obsolecense.
I’m not a heavy web or software developer, so I was looking around for off-the-shelf (off-the-net?) open source tools I could use. I like the power and simplicity of the “drupal”:http://drupal.org/ system, like we use here at “LOPSA”:http://lopsa.org/, and with all the available themes and modules, it looks like I can make a pretty professional looking site that will really surpass expectations.
One thing that isn’t quite so simple with drupal is the administration menus. To create a new node (page), you normally have to go to “Content” -> “Create Content” -> “__nodetype__”. Three clicks, because the menus generally are not dynamic with rollovers (there may be a theme that is, but the theme I’m working with currently isn’t).
For the people I’m making this site for, that’s going to be a big usability issue. I’m going to have several sections on the site, such as Products, In-Store Events, etc. I’d like to have a link on the main section page that allows them to create a node of that particular type. Which is pretty easy, right? Just a URL with a destination of @node/add/product@ or @node/add/event@ or whatever.
However, I only want that to show up if the viewer is an admin (an event coordinator, or a store manager, for example). I don’t want the link there if it is a customer that is viewing the page.
So, I go check the drupal website looking for role based page output. Closest thing I can find is “menu visibility”:http://drupal.org/node/77414, which says it can’t be done for menus unless you hand craft them as a block. But, “jeff h” recently provided a way to do it in the block with
bq.
<?php
global $user;
if (in_array(‘Approved Role’, $user->roles)) {
print ‘<a href=”linkforapprovedroleonly””>for approved role only</a>’;