View Full Version : Switchable content layer?
gsummerlin
11-02-2005, 07:31 PM
hey guys,
i've got an issue with a site that i'm developing. The restaurant wants to have the daily specials menu listed on the homepage. They also want lunch and dinner specials to be avaible. I have created this, but to switch from lunch to dinner specials, they have to click to another page.
it's probably easier for you to view this yourself at:
http://www.mymtvernon.com/index.shtml
one more twist: i have created a folder where 2 .txt/.html files will be accessible by the restaurant (dinner_specials.html & lunch_specials.html) for editing. i have these files codes as 'includes' on these pages.
any help will be greatly apprecited and will increase one's karma exponientially.
thanks,
grant
dtroi50
11-03-2005, 01:50 AM
Try using a server side language, for instance PHP.
<?php
#This script will require the file to be named .php, .phtml, or some other sort
#of PHP extension. The variables will be accessed through the URL, as in
#http://mymtvernon.com/?menu=dinner
#The default menu is what will be loaded if they go to http://mymtvernon.com
#without the variable set.
$menu = $_GET['menu'];
switch ($menu) {
case 'dinner' : include('path/to/dinner.php'); break;
case 'lunch' : include('path/to/lunch.php'); break;
}
//if variable is not set, include a default menu
if(!isset($_GET['menu'])) {
include('');//change that to the path to your default menu
}
?>
Also, on a side note, tables for layout is a bad idea, as are <b> tags.
Try making a layout with CSS using float, margin, and clear. Instead of the <b> tags in the menu, you should use headings and style them to your liking.
For some reason you have an XHTML 1.0 Transitional (eww) doctype as well as an HTML 4.01 Transitional (even more eww) doctype, the latter is inside your <html> tag. You should choose one or the other.
Wedgy
11-03-2005, 11:06 PM
I had a basic solution for this problem on my website using a simple unordered list to create tabs on a box. You can then have a stable webpage and either switch menu html pages in and out based on day of the week, or simply let the user click on different tabs to find out variations in the menu.
Have a look here:
My Cheesy Website (http://lentils.imagineis.com)
dtroi50
11-05-2005, 12:32 AM
Javascript is great, but what if someone has it turned off? It stops working.
Wedgy
11-05-2005, 12:35 AM
What percentage of users would that be?
Make them turn it on again.
mwinter
11-05-2005, 02:58 AM
[Disabled client-side scripting]
What percentage of users would that be?That would entirely depend on the audience in question. It could be as few as 0%, as many as 100%, or anywhere in between. Statistics on the Web are useless.
Make them turn it on again.That neither helpful, responsible, nor realisitic. In some cases, the visitor won't have a choice. In others, the user made that choice for specific reasons, so it would be arrogant on the author's part to think they know better.
If a document on the Web relies on client-side scripting to be functional, the author of that document does not understand the Web. ECMAScript is, has been, and will likely forever remain an optional technology. Treating it as anything else is, in all but a few exception cases (like a script demonstration site), a foolish thing to do. Any system using it should be designed to degrade gracefully. After all, total lack of support is not the only reason why a script might fail.
Mike
Wedgy
11-06-2005, 11:11 AM
I just realized I got conned listening to dtroi50 instead of the original poster.
My method isn't javascript, its an unordered list in CSS.
It calls a small js function on mouseclick.
I don't know what the dtroi50 is on about, but DHTML (DYNAMIC=changing HTML)
means using javascript to change the page content.
There isn't any DHTML without javascript. (unless you bring in an even more obscure language like Visual Basic).
You could have 'changing' content using a mouseover trick in CSS,
with either a text or graphic version of the lunch and dinner menus,
(but you'd probably have to keep them simple and small to do this well.)
Large long menu graphics would be too slow to load, or else you could
keep the reader busy while they were loading.
mwinter
11-06-2005, 05:00 PM
For some reason you have an XHTML 1.0 Transitional (eww) doctype as well as an HTML 4.01 Transitional (even more eww) doctype [...]If the OP must choose one of those, it should be the HTML Transitional document type declaration, not least because XHTML is not feasible on the Web. Ideally, however, the document should be rewritten to conform to the HTML 4.01 Strict DTD.
Mike
Wedgy
11-08-2005, 01:03 PM
what is the difference between xhtml and strict html?
why is one not feasable?
mwinter
11-09-2005, 02:35 PM
what is the difference between xhtml and strict html?The question should either be, "What's the difference between HTML and XHTML?", or, "What's the difference between the Transitional and Strict DTDs?" I only mentioned HTML Strict explicitly because that should be the target for all new documents on the Web.
HTML is an application of the Standard Generalized Markup Language (SGML), though most user agents don't parse it that way. SGML is a very powerful markup language, also used to define other markup languages (HTML is a case in point).
XHTML is an application of XML, which is a profile (subset) of SGML. XML, and therefore XHTML, is meant to be simpler and easier to parse than full SGML. For instance, XML enforces the rule that documents must be well-formed. If a parser encounters a document that isn't, it must refuse to process it. Note that well-formedness doesn't imply validity, but a document cannot be valid unless it's well-formed.
Most of the differences between HTML and XHTML are syntactic. One exception is that XHTML Strict has obsoleted (removed) elements that were declared deprecated in HTML 4.01. Deprecated elements are still present in the XHTML Transitional DTD, but I don't believe Transitional XHTML should be taken seriously.
why is one not feasable?IE doesn't support XHTML, and neither do many older browsers.
Mike
Wedgy
11-13-2005, 01:42 AM
If most (all?) browsers don't support XHTML, who is using it, and why?
Should I redo my pages to conform to XHTML, if no browser can read it?
This part is not clear to me at all.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.