are different template views for different browsers possible

Skinning and designing Serendipity (CSS, HTML, Smarty)
Post Reply
verbatim
Regular
Posts: 43
Joined: Sat Mar 12, 2005 10:53 pm

are different template views for different browsers possible

Post by verbatim » Fri Aug 05, 2005 11:56 pm

is it possible to edit the index.tpl & style.css files so that they perform one way in internet explorer and another way in netscape?

i would simply like to add a "<div>" in my style.css file but only to affect the template when it appears in a netscape browser?

how can this be done??

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: are different template views for different browsers poss

Post by garvinhicking » Sat Aug 06, 2005 12:55 pm

You can do that either with

Code: Select all

<!--[if IE]>
type the stuff that only should appear in IE here
<![endif]-->


or you can use javascript browser-checks in your index.tpl to denote that. You could also write a plugin that uses different templates based on the HTTP string.

But I discourage all those efforts. Creating different pages for different browser shouldn't be done - you should always get similar results when using some CSS hacks, that should suffice.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/

verbatim
Regular
Posts: 43
Joined: Sat Mar 12, 2005 10:53 pm

Post by verbatim » Sat Aug 06, 2005 4:50 pm

thanks for the reply.

any idea why this page looks different in IE and netscape?

all i did was add an image in the line right below the following code in the index.tpl

Code: Select all

div id="serendipity_banner">
     <h1><a class="homelink1" href="{$serendipityBaseURL}">{$head_title|@default:$blogTitle}</a></h1>
    <h2><a class="homelink2" href="{$serendipityBaseURL}">{$head_subtitle|@default:$blogDescription}</a></h2>
[/url]

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking » Sat Aug 06, 2005 5:30 pm

Your CSS code has an error; check your definition in the CSS of #serendipity_banner. It is defined with

Code: Select all

    height: 72px;


but of course your image is higher than 72px, so you need to adjust the #serendipity_banner element.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/

Post Reply