Problems with IE ignoring the css

Phoca Gallery - image gallery extension
Pinhead
Phoca Member
Phoca Member
Posts: 10
Joined: 27 May 2008, 08:30

I have a strange pro

Post by Pinhead »

I have a strange problem here, and would be very grateful if you could solve it.
The problem is that in Opera and Firefox the page looks fine, but in IE the css gets ignored and I see the ugly internals. I have tracked the problem down to understanding that it's caused by the same line of code appearing too many times in the page's source. Here is what I have as a result in the source ocde of my frontpage.

<style type="text/css">

</style>

<!--[if IE]>
<link rel="stylesheet" href="/newzhesht/components/com_phocagallery/assets/phocagall
eryieall.css" type="text/css" />
<![endif]-->
<style type="text/css">

</style>
<!--[if IE]>
<link rel="stylesheet" href="/newzhesht/components/com_phocagallery/assets/phocagall
eryieall.css" type="text/css" />
<![endif]-->
<style type="text/css">

</style>
<!--[if IE]>
<link rel="stylesheet" href="/newzhesht/components/com_phocagallery/assets/phocagall
eryieall.css" type="text/css" />
<![endif]-->
<style type="text/css">

</style>
<!--[if IE]>
<link rel="stylesheet" href="/newzhesht/components/com_phocagallery/assets/phocagall
eryieall.css" type="text/css" />
<![endif]-->

<style type="text/css">

</style>
<!--[if IE]>
<link rel="stylesheet" href="/newzhesht/components/com_phocagallery/assets/phocagall
eryieall.css" type="text/css" />
<![endif]-->
<style type="text/css">

</style>
<!--[if IE]>
<link rel="stylesheet" href="/newzhesht/components/com_phocagallery/assets/phocagall
eryieall.css" type="text/css" />
<![endif]-->
<style type="text/css">

</style>
<!--[if IE]>
<link rel="stylesheet" href="/newzhesht/components/com_phocagallery/assets/phocagall
eryieall.css" type="text/css" />
<![endif]-->
<style type="text/css">

</style>

<!--[if IE]>
<link rel="stylesheet" href="/newzhesht/components/com_phocagallery/assets/phocagall
eryieall.css" type="text/css" />
<![endif]-->
<style type="text/css">

</style>
<!--[if IE]>
<link rel="stylesheet" href="/newzhesht/components/com_phocagallery/assets/phocagall
eryieall.css" type="text/css" />
<![endif]-->
<style type="text/css">

</style>
<!--[if IE]>
<link rel="stylesheet" href="/newzhesht/components/com_phocagallery/assets/phocagall
eryieall.css" type="text/css" />
<![endif]-->
<style type="text/css">

</style>
<!--[if IE]>
<link rel="stylesheet" href="/newzhesht/components/com_phocagallery/assets/phocagall
eryieall.css" type="text/css" />
<![endif]-->

<style type="text/css">

</style>
<!--[if IE]>
<link rel="stylesheet" href="/newzhesht/components/com_phocagallery/assets/phocagall
eryieall.css" type="text/css" />
<![endif]-->
<style type="text/css">

</style>
<!--[if IE]>
<link rel="stylesheet" href="/newzhesht/components/com_phocagallery/assets/phocagall
eryieall.css" type="text/css" />
<![endif]-->
<style type="text/css">

</style>
<!--[if IE]>
<link rel="stylesheet" href="/newzhesht/components/com_phocagallery/assets/phocagall
eryieall.css" type="text/css" />
<![endif]-->
<style type="text/css">

</style>

<!--[if IE]>
<link rel="stylesheet" href="/newzhesht/components/com_phocagallery/assets/phocagall
eryieall.css" type="text/css" />
<![endif]-->
<style type="text/css">

</style>



I've noticed that if I leave only one copy of that code in my local version of the website that I "saved as", the page looks fine in IE. Now, the question is what makes the code dublicated that many times, and what can I do to fix it!

Here's the actual page
http://www.pinhead.website.am/newzhesht

Thanks a lot in advance!
Pinhead
Phoca Member
Phoca Member
Posts: 10
Joined: 27 May 2008, 08:30

I just noticed somet

Post by Pinhead »

I just noticed something! The number of dublicate codes is equal to the items that I have on the front page! I just checked it, put only 5 items on the frontpage, and now it looks fine in IE, and in the source code there are 5 dublicates of the code.
I guess IE just refuses to show a proper website after it parses the same code for n-th time (maybe 10?)

Anyway, so it means that a single instance of that code comes with every posted content item
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Hi, which version of

Post by Jan »

Hi, which version of plugin do you use?

jan
If you find Phoca extensions useful, please support the project
chipsfrisch
Phoca Newbie
Phoca Newbie
Posts: 7
Joined: 01 Jun 2008, 11:39

Hi Jan,(

Post by chipsfrisch »

Hi Jan,

(sorry for my English)

I've detected the same problem using Phoca 1.81 and now new 1.85 with Joomla 1.53 in legacy mode.

Depending on showed articles on the page (not only frontpage) Phoca adds the same amount of the code fragement:
<!--[if IE]>
<link rel="stylesheet" href="/components/com_phocagallery/assets/phocagalleryieall.css" type="text/css" />
<![endif]-->
<style type="text/css">

</style>

This is ok for Firefox but IE isnt able to show the site with its usual design.

I will generate a menu "PHOCA" on the page URL so you can check it with IE.

What part of phoca generates this code severeal times?

Thx for help
Micha
chipsfrisch
Phoca Newbie
Phoca Newbie
Posts: 7
Joined: 01 Jun 2008, 11:39

It seems that there

Post by chipsfrisch »

It seems that there are several possible add-points:

Each view.html.php adds the code.

These files can be found in
\front\views\categories
\front\views\category
\views\phocagalleryf
\views\phocagalleryi
\views\phocagallerys

One of these is wrong, isn't it?
chipsfrisch
Phoca Newbie
Phoca Newbie
Posts: 7
Joined: 01 Jun 2008, 11:39

I've edited the

Post by chipsfrisch »

I've edited the
view.html.php

online in the folders
\view\categories
\view\category


and removed (//) the part, but that didnt change any.

Perhaps a plugin is responsible?
chipsfrisch
Phoca Newbie
Phoca Newbie
Posts: 7
Joined: 01 Jun 2008, 11:39

Ok, PROBLEM SOLVED

Post by chipsfrisch »

Ok, PROBLEM SOLVED

It was the plugin:

Edit the file
\plugins\content\phocagallery.php

Remove the lines 1583-1599:

// All custom CSS tags will be added into one CSS area

// $document->addCustomTag( "<style type=\"text/css\">\n"

// . $customCSS2 . "\n"

// . $customCSS

// ." </style>\n");





//END CSS

// $document->addCustomTag("<!--[if IE]>\n<link rel=\"stylesheet\" href=\"".JURI::base(true)."/components/com_phocagallery/assets/phocagalleryieall.css\ " type=\"text/css\" />\n<![endif]-->");



Thats it.

Hope so.
totcamping
Phoca Member
Phoca Member
Posts: 36
Joined: 30 May 2008, 23:21

Hi, THANK YOU

Post by totcamping »

Hi,
THANK YOU VERY MUCH

have a nice day, a week, and all the year, I was very tired of this problem.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

chipsfrisch

Post by Jan »

chipsfrisch
Hi, you have disabled the IE CSS for the Phoca Gallery plugin (nothing more)... The reason, why there are so many IE CSS links, is that you run the plugin more times... (please don't change anything in the component, the component doesn't hang together with the plugin...

So if you delete the CSS, no CSS for IE will be enabled...

the problem is, you call the plugin more times, it is the same as if you call e.g. 10 different plugins. Every from them will loaded own CSS style... Then next proplem is that there is no way how to recognize that 1 instance of plugin is loaded and no more CSS link to IE should be created ...
If you find Phoca extensions useful, please support the project
chipsfrisch
Phoca Newbie
Phoca Newbie
Posts: 7
Joined: 01 Jun 2008, 11:39

Hi Jan,t

Post by chipsfrisch »

Hi Jan,

thank you for your reply.
Waited for a professional comment by you!

But I dont know if you are right?!

Didnt change any to the component only the plugin as written above.

I didnt load the plugin more than 1 time.
The plugin seems to get loaded for each article that has to be published on the side.
So you have 10(+1) IE-CSS parts in the html-page if you have 10 (un-)posted articles in blog-style in a category or section.

As the problem seems to be solved and IE makes now a correct layout and NOT before deleting these lines I think the plugin should add the CSS parts in a different way.

If you agree there was a problem with the added CSS lines.

Tell me how to reduce the instances of the plugin and I will do it.
Just searched here the last 15 hours (ok, i'm slow) to find the problem.

Thank you for your great plugin and component by the way.
So far it is the best thing on the homepage, i think.

greetings
micha
Post Reply