You are here: Re: A: active link « HTML « IT news, forums, messages
Re: A: active link

Posted by Jonathan N. Little on 06/23/06 14:51

Jim Moe wrote:
> Kevin Scholl wrote:
>>>> EX: Global tool page included a link to the news page. It is colored black
>>>> like all the othe links listed in the global tool page. Once you have
>>>> navigated to the news page, the link for that page has now changed to red in
>>>> the global tool bar. I thought that was what A: active link is used for but
>>>> I think I am wrong.
>>>>
>>> The closest you can get with CSS is a:visited, but it is not unique. If
>>> you set it to red, all the other visited links are red as well.
>> It actually can be done quite easily with only CSS. There are several
>> tutorials for it online; here's a pretty straight forward one:
>>
>> http://www.hicksdesign.co.uk/journal/highlighting-current-page-with-css
>>
> Well, I was not considering having to do it all manually.
> The method described above does not scale well; it needs a unique ID for
> every page and menu item, a lot of cruft builds up in the CSS files. Using
> SSIs does not scale easily either since a unique file is needed for each
> page's menu.
>

My solution was to build a menu class in PHP. The class contains,
organizes and generates my menu and site map. The hierarchal structure
is stored in the object as such. It generated the IDs for both and uses
a scheme that encodes the page's location within the tree in the IDs.
'mm######', each number pair is a level's id so each level can have a
max of 99 pages. Therefore a page link with an id of 'mm020100' means it
is the first child of parent of menu 'mm0001' that is the 2nd child of
'mm02' that is the third child of the root 'mm'. The id is also the key
in an array of references to each 'leaf' akin to MS's 'all' in their DOM
for quick lookups.

Works for me. I can build my breadcrumb trail links and flag each parent
of a menu with an 'active' class when the menu is created...HTH

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация