Dropdown Categories

Skinning and designing Serendipity (CSS, HTML, Smarty)
Post Reply
danst0
Regular
Posts: 197
Joined: Tue Jul 13, 2004 10:50 am

Dropdown Categories

Post by danst0 »

Hi,

I just made up my mind and I would like to have a drop down menu for my categories in my blog. So from my Site Navigation (see screenshot) I would like to have a similar styled drop down menu which is automatically feed by my categories.

Is there already some code out there someone would share?

Daniel
Attachments
Screen Shot 2011-08-12 at 18.03.13.png
Screen Shot 2011-08-12 at 18.03.13.png (96.74 KiB) Viewed 7528 times
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Dropdown Categories

Post by garvinhicking »

Hi!

You might want to heckout the serendipity_plugin_dhtml_categories (or something like that) plugin. It uses an outdated PEAR DHTML_Category module that is no longer properly maintained, but the basic idea on how to fetch the categories should still apply and make it possible to output a HTML tree that JavaScript can use to transform into a dropdown...?

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
danst0
Regular
Posts: 197
Joined: Tue Jul 13, 2004 10:50 am

Re: Dropdown Categories

Post by danst0 »

Hi,

I am trying to integrate my drop down menu into my template and many questions arise. The first is:

* How can I access the stored configuration of the theme from within the config.inc.php of my theme?

Daniel
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: Dropdown Categories

Post by Don Chambers »

Look at the bulletproof template for code to retrieve template options.
=Don=
danst0
Regular
Posts: 197
Joined: Tue Jul 13, 2004 10:50 am

Re: Dropdown Categories

Post by danst0 »

@Don, Thanks, I will do that.

@All, I have now a semi-working implementation of the drop down mechanism. I just don't get why the submenus are not displayed next to the cursor / parent category but they always start at the top...

Could someone give me a hint what css would fix that?

Daniel

ps. the link is http://test.scrmblog.com
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: Dropdown Categories

Post by Don Chambers »

Search for "son of suckerfish" or "suckerfish css"... numerous examples available.
=Don=
danst0
Regular
Posts: 197
Joined: Tue Jul 13, 2004 10:50 am

Re: Dropdown Categories

Post by danst0 »

Yeah, that's where I have most of my inspiration from, the only thing I don't get is how to place each submenu next to the (prior) menu entry and not always on top.

Daniel
danst0
Regular
Posts: 197
Joined: Tue Jul 13, 2004 10:50 am

Re: Dropdown Categories

Post by danst0 »

Ok, I now got the drop down menu working for the major part now in standard compatible browsers. (test.scrmblog.com -> Categories) So I have two issues left:
* Ipad: Since there is no hover I have problems to navigate through the whole categories menu. Is it somehow possible to use the first click on an item as a hover event and the second click as real click?

* IE 8 and below: The screenshots show that the drop down is not rendered well in IE 8. I can think of two options: a) I made a css mistake and / or it could be fixed somehow in the style.css b) Is it possible to have two alternative sites for IE and for browsers? So that if someone with IE surfs by I get the old sidebar categories menu and if a browser surfs by the CSS Dropdown is presented? But how / where could I differentiate between the browsers?

Daniel
Attachments
ie8 drop down
ie8 drop down
Screen Shot 2011-08-23 at 15.40.49.png (211.6 KiB) Viewed 7448 times
Safari Drop Down
Safari Drop Down
Screen Shot 2011-08-23 at 15.41.04.png (192.31 KiB) Viewed 7448 times
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: Dropdown Categories

Post by yellowled »

danst0 wrote:* Ipad: Since there is no hover I have problems to navigate through the whole categories menu. Is it somehow possible to use the first click on an item as a hover event and the second click as real click?
Even if so, it would probably interfere with other touch screen gestures like double tap to zoom in. There are ideas to replace menus with select elements (using JS) on touch screen devices, but I'm not sure this would be easy to pull of for a nested ul used for a dropdown menu. Also potentially without any fallback for device without JS support. Then again, I'm not a JS guru. :)

http://css-tricks.com/13303-convert-menu-to-dropdown/
danst0 wrote:a) I made a css mistake and / or it could be fixed somehow in the style.css
Depends. Could you post just the CSS used for the dropdown menu?
danst0 wrote:b) Is it possible to have two alternative sites for IE and for browsers? So that if someone with IE surfs by I get the old sidebar categories menu and if a browser surfs by the CSS Dropdown is presented? But how / where could I differentiate between the browsers?
It is possible using rather horrible hacks like using conditional comments to emit different HTML, but I don't think it's worth the effort for a single browser.

YL
Post Reply