Click to See Complete Forum and Search --> : Drop Down menu in external html file


drnic010
05-15-2009, 05:13 AM
Hey guys,

Here's one I think you'll find interesting...

I'm currently in the process of creating an intranet site for my workplace. It consists of a home page and a number of content pages, all of which have the same layout. Each page can be split into a number of containers (if you could refer to them in that way), each a separate <div>. Each of these pages has one particular container (that appears also in the home page) that contains a drop down menu created using the Son of Suckerfish (http://htmldog.com/articles/suckerfish/dropdowns/) method.

The problem is, the drop down menu will probably need to be updated sometime in the future and, instead of creating the entire site and then finding I need to add an extra link on 70 odd pages, I thought it may be a good idea to store this drop down menu in an external file.

I originally did some research into Server Side Includes, but found that these would not be supported by my workplaces server.. Reluctant to put yet MORE of the code into an external javascript file, I instead decided to put the code into an external html file and link it through an object in the main pages (using the 'data' attribute).

This has worked to a certain extent.

I have the drop down menu appearing and working on the page, however, it appears in a white box that obscures the content below it...

I've tried reducing the height but this cuts off the menus that drop down and adding in a background is simply out of the question as the content below it is constantly changing.

My question is: Is there any way to make the white background of this external html file transparent? And if not, can anybody think of another way to implement my drop down menu from an external file? (I'm up for using Javascript again, but ONLY if I have to...)

Cheers guys, sorry for the essay :)

Nic.

KDLA
05-15-2009, 08:33 AM
Your server does not support any type of server-side include? Very strange.

drnic010
05-15-2009, 09:18 AM
Not that I'm aware of...though I'm very new to Server Side coding anyway so that doesn't really mean much...(hopefully I'll be a bit more knowlegable after my 3rd university year.)

Anyway, I'm looking for a client side method if possible, include or otherwise.

Thanks!

Charles
05-15-2009, 09:35 AM
Do not lower yourself by using JavaScript for an include. Frames would be a more honorable solution. Server side is the way to go, and an opportunity to learn something new. But there is a client side method for XHTML. It's a bit more involved than other methods but way powerful.

Start with each of the pages of your site in XHTML containing just the dynamic content. Save each XHTML file with an XML filename extension and with an XSLT stylesheet reference in the prolog. Then you create that XSLT stylesheet with all of the static content. Your menu can be in any of three places as suits you. It can be in the stylesheet itself or you can use an external entity to include it into either the XSLT or the XHTML.

See http://www.w3schools.com/xsl/ .

drnic010
07-13-2009, 07:50 AM
Hey guys, just thought I'd let you know that I got this problem sorted :)
I ended up using SSI to link code in external html files to my main shtml files.
I found that our server DID support them, I just hadn't got it set up properly.
A very useful technique to know!
Thanks for your help :)