Page 1 of 1
Dropdown Categories
Posted: Fri Aug 12, 2011 6:14 pm
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
Re: Dropdown Categories
Posted: Sat Aug 13, 2011 12:01 pm
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
Re: Dropdown Categories
Posted: Mon Aug 15, 2011 1:50 pm
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
Re: Dropdown Categories
Posted: Mon Aug 15, 2011 4:58 pm
by Don Chambers
Look at the bulletproof template for code to retrieve template options.
Re: Dropdown Categories
Posted: Tue Aug 16, 2011 10:53 am
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
Re: Dropdown Categories
Posted: Tue Aug 16, 2011 11:33 pm
by Don Chambers
Search for "son of suckerfish" or "suckerfish css"... numerous examples available.
Re: Dropdown Categories
Posted: Wed Aug 17, 2011 6:16 am
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
Re: Dropdown Categories
Posted: Tue Aug 23, 2011 3:58 pm
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
Re: Dropdown Categories
Posted: Tue Aug 23, 2011 11:14 pm
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