Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Switchable content layer?

  1. #1
    Join Date
    Jul 2005
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Switchable content layer?

    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

  2. #2
    Join Date
    Sep 2005
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Try using a server side language, for instance PHP.
    PHP Code:
    <?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.
    Last edited by dtroi50; 11-03-2005 at 01:53 AM. Reason: Forgot a stuff (yes. I forgot A stuff.)

  3. #3
    Join Date
    Nov 2005
    Posts
    93
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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

  4. #4
    Join Date
    Sep 2005
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Javascript is great, but what if someone has it turned off? It stops working.

  5. #5
    Join Date
    Nov 2005
    Posts
    93
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    What percentage of users would that be?
    Make them turn it on again.

  6. #6
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Wedgy
    [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

  7. #7
    Join Date
    Nov 2005
    Posts
    93
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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.
    Last edited by Wedgy; 11-06-2005 at 11:15 AM.

  8. #8
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by dtroi50
    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

  9. #9
    Join Date
    Nov 2005
    Posts
    93
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    what is the difference between xhtml and strict html?
    why is one not feasable?

  10. #10
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Wedgy
    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

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •