Skip over navigation

Please note that you're viewing an, older archived version of this page. You probably found it through Google, an older link, or post. Please visit our home page for the current site.

Blog: Design

You are here

22 Mar 04 by DL Byron

In the column nav above, I use a “you are here” indicator that I call “onstate”. The onstate in the second column is a link with square bullet and normal font weight. The onstate in the third column is a link with a normal font weight. I think that works well, but when I started using Movable Type to build the third column based on the blog categories, the onstate was lost. I consulted with Doug Manis and he coded some php:

For the Category Archive
// get page name from URL and use that to override the
link style

$this_url = $_SERVER['PHP_SELF'];  // get current URL
$file_name = basename($this_url);  // get filename from URL

// the file names for the sub-category pages
$file_names = array('cat_almost_daily.htm', 'cat_clients.htm',
'cat_clipnseal.htm', 'cat_design.htm', 'cat_our_strange_world.htm');

// the MT generated category IDs
$mt_ids = array('4', '1', '5', '2', '3');

// replace the file name with the MT category name
$id_name = str_replace($file_names, $mt_ids, $file_name);  

For the Individual Archive:

// get story category from MT

$file_name = '<$MTEntryCategories$>
<$MTEntryCategory$></MTEntryCategories>';
// get filename from URL

// the file names for the sub-category pages
$file_names = array('Almost Daily', 'Clients', 'Clip-n-Seal',
'Design', 'Our strange world');  

// the MT category IDs
$mt_ids = array('4', '1', '5', '2', '3');

// replace the file name with the MT category name
$id_name = str_replace($file_names, $mt_ids, $file_name);  

In the style:

#cat_ a:visited {
font-weight: normal;
background: transparent;
color: #336699;
}

#cat_ {
list-style: none
}

and html:

<li id="cat_<$MTCategoryID$>">

Now, there maybe a more elegant way to do this, but it works.

filed under: Design | Link Cosmos | View Comments (0) | post your comment (closed)

Comments

Note: comments are closed. If you'd like to comment on this post, please contact us.