The Serendipity Handbook

You can now read the (german) handbook here: PDF - https://github.com/s9y/Book (LaTeX source).

Forum-Information

Before posting about errors, make sure that the answer cannot already be found in our FAQ or by searching this forum!
Posting is restricted to registered users (registering is free and simple!) due to recent spam attacks. When having trouble with this board, contact garvin(-at)s9y(-dot)org.

Board index Themes Dropdown Categories

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

Postby danst0 » Fri Aug 12, 2011 6:14 pm

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

User avatar
garvinhicking
Core Developer
 
Posts: 28953
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany

Postby garvinhicking » Sat Aug 13, 2011 12:01 pm

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

Postby danst0 » Mon Aug 15, 2011 1:50 pm

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

User avatar
Don Chambers
Regular
 
Posts: 3077
Joined: Mon Feb 13, 2006 3:40 am
Location: Chicago, IL, USA

Postby Don Chambers » Mon Aug 15, 2011 4:58 pm

Look at the bulletproof template for code to retrieve template options.

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

Postby danst0 » Tue Aug 16, 2011 10:53 am

@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

User avatar
Don Chambers
Regular
 
Posts: 3077
Joined: Mon Feb 13, 2006 3:40 am
Location: Chicago, IL, USA

Postby Don Chambers » Tue Aug 16, 2011 11:33 pm

Search for "son of suckerfish" or "suckerfish css"... numerous examples available.

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

Postby danst0 » Wed Aug 17, 2011 6:16 am

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

Postby danst0 » Tue Aug 23, 2011 3:58 pm

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
Screen Shot 2011-08-23 at 15.40.49.png
ie8 drop down
Screen Shot 2011-08-23 at 15.40.49.png (211.6 KiB) Viewed 870 times
Screen Shot 2011-08-23 at 15.41.04.png
Safari Drop Down
Screen Shot 2011-08-23 at 15.41.04.png (192.31 KiB) Viewed 870 times

User avatar
yellowled
Regular
 
Posts: 4884
Joined: Fri Jan 13, 2006 12:46 pm
Location: Eutin, Germany

Postby yellowled » Tue Aug 23, 2011 11:14 pm

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



Return to Themes

Who is online

Users browsing this forum: No registered users and 2 guests