Reply to Re: A: active link

Your name:

Reply:


Posted by Jim Higson on 06/23/06 16:40

Jonathan N. Little wrote:

> 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
>

IMO, styling a link differently using CSS for the current page isn't the
best way because there isn't really any point in a page containing links to
itself.

I always prefer to replace links to the current page with span elements. I
give these the class "nonlink" or something like that so they can be styled
in a way that suggests they would be a link if they weren't not :)

--
Jim
http://surfcore.co.uk

[Back to original 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

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