Choose Custom based on browser?

Forums Forums Menus Choose Custom based on browser?

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #594
    maidanet
    Member

    My site uses a lot of transparent full color pngs.  Using the WordPress template system, I was able to write different code for IE6 that shows a .jpg instead of the png.

    Using PHP, I check the browser and includes a different template file if it is IE6.  Like this:

    [tt:28d36ryu]<?php $navigator_user_agent = ( isset( $_SERVER['HTTP_USER_AGENT'] ) ) ? strtolower( $_SERVER['HTTP_USER_AGENT'] ) : ''; ?>
    <?php if (stristr($navigator_user_agent, "msie 6")){include (TEMPLATEPATH . '/searchform_ie6.php');}
    else{include (TEMPLATEPATH . '/searchform.php');}?>[/tt:28d36ryu]

    Since I can’t use PHP in the multi level menu, I was wondering if there were a way I could choose the Custom Code when I check the browser settings.

    It’s late and I might not be making sense…

    My CSS is in the plug in settings page:
    [tt:28d36ryu]#suckerfishnav {font-size:18px;font-family:verdana,sans-serif;font-weight:bold;}
    #suckerfishnav, #suckerfishnav ul {float:left;list-style:none;padding:0;margin:0;width:103px;}
    #suckerfishnav a {display:block;color:#ffffff;text-decoration:none;padding:0;}
    #suckerfishnav li {float:left;padding:0;}
    #suckerfishnav ul {position:absolute;left:-999em;height:auto;width:103px;font-weight:normal;margin:0;border:0;}
    #suckerfishnav li:hover, #suckerfishnav li.sfhover {color:#000000;}

    #suckerfishnav li li {width:100px;font-weight:bold;font-family:arial,sans-serif;text-align:left;}
    #suckerfishnav li li a {padding:5px;width:90px;font-size:11px;color:#ffffff;}

    #suckerfishnav li ul ul {margin:0;}[/tt:28d36ryu]

    URL: http://www.telematrixinc.com/scitec

    #5087

    I don’t intend to add any browser targetting systems to the plugin.

    I generally recommend using IE conditional comments to control background images displayed as a way of coping with the lack of PNG transparency support in IE6. I don’t see any point in using JPEG’s for that though as they don’t support transparencies either, GIF is usually the alternate file type.

    #5088
    maidanet
    Member

    Using transparent gifs are not an option in this case for some of the images because 255 colors is not enough to render the designer’s button images.

    I’m actually not looking for a browser targeting system.

    Right now, I’m doing the browser checking myself and using different template php files in the same theme.  topnav_ie6.php for IE6 and topnav.php for other browsers, for example.

    I’m just looking for a way to use a different custom code for the same menu.

    #5089

    I’m totally lost then. If you aren’t doing browser sniffing, then what do you have seperate template files for? I am confused.

    #5090
    maidanet
    Member

    [quote:1udm5toq]I don’t intend to add any browser targetting systems to the plugin.[/quote:1udm5toq]

    I was just clarifying that I wasn’t asking for one from you.

    I just thought there might be a way that I could choose from Custom HTML 1 or Custom HTML 2 for a particular navigation bar.

    I happen to be browser sniffing, but there could be other conditions where one might want different looks for different situations.

    No worries.  I can find a work-around. <img decoding=” title=”Smiley” />

    #5091

    You could serve one menu to one set of browsers, and another to other browsers. There is an option in the latest versions of the plugin which allows you to have two entirely different menus.

    #5092
    maidanet
    Member

    I think you sent me that answer telepathically, because I woke up this morning and that very solution came to me!

    Clearly I need a life outside of website work.  :

    Thanks for a great plug in!

    Maida

    #5093

    Glad to hear you found a solution <img decoding=” title=”Smiley” />

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.