Textura Design is a creative force specializing in business blogging for clients big and small.

Textura Design Blog

You are here

posted by DL Byron on March 22, 2004

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.


other posts tagged:


Note: comments are closed.