XML for my product lists and rollover menus?
August 27, 2006 4:42 PM   Subscribe

Are there any good XML/XHTML frameworks for using XML data to automatically populate both/either web page content and JavaScript rollover menus?

I'm working on a website for a client; it will basically be an online brochure for available products in a bricks-and-mortar store (without any merchant features). We've already decided that this site will have an index page with a rollover menu, and that the menu will link to subpages populated with product content.

I've now realized that, as opposed to writing everything out in (X)HTML, I could compose XML files with all the appropriate product data - a field for the product name, description, thumbnail filename, full-size filename - and make a general template page that could read XML data and populate a list with it. While we're at it, why not do the same thing for the navigation menu? Not only would that allow me to flexibly change the product menu whenever I want, but it would keep the menu consistent for the whole site. As a former applications programmer (ASP, C++, SQL), this sounds like life would be great if I could get both to work.

So before I either try writing this in PHP (which is a new language for me) or contracting the work out on some freelancing site, does a framework or template exist (open source, perhaps) to just drop this into my site and go with it? Or is this application really simple enough to do in an hour of my spare time? If I have to code it myself + debug it, I may simply do everything by hand in existing authoring programs the way it is classically done, at the expense of tedium in making future updates. (Plus, I have to provide deliverables to my client sometime in the next few weeks. In this case, "finished quickly" is way better than "elegant".)
posted by brianvan to Computers & Internet (4 answers total) 2 users marked this as a favorite
Well, this is essentially what XSLT is designed for. That being said, it is (in my experience) fiendishly complex, and if you've never done anything like this before, you probably can't produce a good XSLT-based site like this in such limited time without killing yourself.

Have you considered using a pre-written Content Management System that would generate the appropriate output? This would allow the client to change product data through a web interface and for the site to be dynamically generated based on the current data, without having to custom-develop a dynamic site like this. I don't have any suggestions, but others might.

Otherwise, you could always fall back on your experience and build a database-based site. If you use a toolkit like Ruby on Rails, Maypole, or whatever floats your boat, such a project would be fairly simple.

In addition, Dreamweaver and GoLive have a number of tools for building database-driven sites that turn the process into literally a point-and-click operation. These applications also have strong templating features that you could take advantage of if you go with a static site.

Lastly, I would make sure that a dynamic site is really appropriate for this task. Depending on how frequently the data would be changed, a static site in (X)HTML might well be far cheaper, easier to build, and more suitable for the task at hand. You might want to present the situation to the client: offer them a static site that will take you less time to build and hence cost less, or a dynamic site with more upfront costs, but where it is free for the client to make changes later.
posted by zachlipton at 5:12 PM on August 27, 2006

Response by poster: 1. Will look harder at XSLT. But yeah, yikes.

2. CMS... gah. Or more specifically: I've built my own blogs off of existing blog-specific CMS systems, and I'm not happy with what I've seen. There are others to be sure, but expense should be minimized here.

3. Not sure if Ruby is supported in the environment we have to work on (a cheap Dreamhost account). I don't want to learn Ruby either. These are future considerations, though, so the advice is helpful.

4. This is what I originally set out to do.

5. The client has already paid for the site, and will not offer more money for more features. Also, this is not a client who will ever be updating the website... let's just say that any level of complexity short of Fisher-Price (c) type web forms for all site maintenance will probably not work in the clients hands. I will need to process updates at my hourly rate (which doesn't go down if the work is easier). So figure that someone adept with HTML/JavaScript technology will be making the changes, and will have a great financial incentive to rapidly enter such changes.

BTW, I asked this question because I'm unaware of any XML data-based JavaScript or PHP rollover generators, supporting rollover images and pop-out menus, with CSS for styling. But if that isn't a damn good idea...
posted by brianvan at 8:42 PM on August 27, 2006

Can't most menu rollover be done in CSS these days? Or is there still something in IE that prevents this?
posted by MonkeySaltedNuts at 9:56 PM on August 27, 2006

Response by poster: CSS rollovers are possible, and preferrable when they can be auto-generated like my JavaScript image rollovers. What's most important is not what makes the rollovers work (the basic functionality of menu hover -> pop-up submenu, mouseexit -> hide submenu) but that they work, period.

Yes, CSS support is a little tougher on the browser requirements than plain JS functionality. But it's more than evened out by the fact that there are a lot of people out there who disable JS.
posted by brianvan at 10:20 PM on August 27, 2006

« Older the top of the soup bowl   |   How to treat old ear piercing that's always... Newer »
This thread is closed to new comments.