Forums / Setup & design / How do I test which web browser is used?

How do I test which web browser is used?

Author Message

Aleksandar Adam

Thursday 12 April 2007 12:54:29 am

Hello,

I would like to test which browser is used in my template (because of some incompatibilities between Explorer and Firefox.)

If it is <b>Explorer</b> I would like to show <b>page 1 </b>

and

If it is <b>Firefox</b> I would like to show <b>page 2 </b>

How do I proceed?

Thanks in advance
Aleksandar

Kristof Coomans

Thursday 12 April 2007 12:58:01 am

Hi Aleksander

What about all the other browsers out there? I think showing different pages to different browsers is a bad habit. Maybe there's another way to solve the incompatibility issues? If you tell us what's going wrong then maybe we can help.

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Aleksandar Adam

Thursday 12 April 2007 1:03:19 am

I have pictures on my page and they are placed in layers -

Explorer shows layers correctly, but not the Firefox.

I had to make one more page with pictures in layers which will work with Firefox.

So it is not ez issue it is problem with layers.

Michael Lee

Thursday 12 April 2007 1:41:07 am

Is it possible to use <div> instead?
you can use CSS hacks to solve most browser incompatibilities. Please refer to http://www.webdevout.net/css-hacks.

Michael Lee | Managing Director | ZerusTech Ltd | www.zerustech.com

Skype: zerustech

Aleksandar Adam

Thursday 12 April 2007 1:58:22 am

Layers are defined in stylesheet like this:

#Layer1 {
	position:absolute;
	width:118px;
	height:128px;
	z-index:1;
	left: 116px;
	top: 166px;
}

#Layer2{

etc.
....

so I had to define Layer1 for Explorer and Layer1 for Firefox in different html pages.

If it is some work around to do in one file I will be very gratefull.

Nabil Alimi

Thursday 12 April 2007 2:05:08 am

Hi,

What do you actually call "layer" ?
To which selector are your css styles applied ?

Besides, I agree with Kristof.

My blog : http://www.starnab.com/ezpublish / http://www.starnab.com/ / http://www.assiki-consulting.com
eZ Publish Freelance developper. Feel free to contact me +33 674 367 057
nabil at assiki d0t fr

Aleksandar Adam

Thursday 12 April 2007 2:51:22 am

I'll try as Michael said, with css hacks,

<link href="all_browsers.css" rel="stylesheet" type="text/css">
<!--[if IE]> <link href="ie_only.css" rel="stylesheet" type="text/css"> <![endif]-->

I hope it works in ez, I'll try it tomorrow.

Thanks for all your help guys.

Best regards
Aleksandar

Peter Putzer

Thursday 12 April 2007 2:59:09 am

This hasn't got anything todo with eZ publish. Conditional comments do work very well (if all you need is to differentiate between IE and non-IE). For more advanced browser detection, there's always the eZBrowserSniff contribution ( http://ez.no/community/contribs/template_plugins/ezbrowsersniff_operator ). If you really need it - most things should be solvable by clean CSS coding.

Accessible website starting from eZ publish 3.0 (currently: 4.1.0): http://pluspunkt.at

Softriva .com

Friday 20 April 2007 4:28:56 am

IMHO, this a css question. This site the best for such question.

http://www.sitepoint.com/forums/forumdisplay.php?f=53

OOzy

eZ debug

Timing: Jan 31 2025 01:14:24
Script start
Timing: Jan 31 2025 01:14:24
Module start 'content'
Timing: Jan 31 2025 01:14:24
Module end 'content'
Timing: Jan 31 2025 01:14:24
Script end

Main resources:

Total runtime0.1940 sec
Peak memory usage8,192.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0084 588.0469370.2891
Module start 'content' 0.00840.0136 958.33591,013.7031
Module end 'content' 0.02200.1719 1,972.03913,902.0391
Script end 0.1940  5,874.0781 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00442.2831200.0002
Check MTime0.00140.7088200.0001
Mysql Total
Database connection0.00110.554110.0011
Mysqli_queries0.100551.81551410.0007
Looping result0.00130.64941390.0000
Template Total0.171688.410.1716
Template load0.00080.398510.0008
Template processing0.170888.031210.1708
Override
Cache load0.00050.268010.0005
Sytem overhead
Fetch class attribute can translate value0.00160.807610.0016
XML
Image XML parsing0.00020.106810.0002
General
dbfile0.00482.4880200.0002
String conversion0.00000.003730.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs