Technology Tools for Ministry

Community

Web-Empowered Church User Community
All Categories > Ministry Tools > Discussion Forum Extension > Stylesheet javascript error
Total Posts: 4 - Pages (1): [1]
Author: Barry Gresens
Posted: Jan 09 2008 - 04:35 PM
Subject: Stylesheet javascript error
We have a Pastor's blog using the Discussion Forum extension. Every page that has the plugin installed on it shows a javascript error in Internet Explorer. After some work, I isolated the error to a stylesheet entry:

expression( document.body.clientWidth > 700px ? 700px +"px" : document.body.clientWidth);

which occurs under the class ".tx-wecdiscussion-page" in the stylesheet

<link rel="stylesheet" type="text/css" href="typo3temp/stylesheet_2865154e8d.css" />

that is automatically added to the page by Typo3. An example of a page of that has the error is:

http://www.galileeumc.org/about/blog/?tx_wecdiscussion%5Bshow_date%5D=083107&tx_wecdiscussion%5Barchive%5D=1

Note the javascript error at the bottom left of the IE window. Is this a bug that can be fixed? Any help would be appreciated.

-Barry Gresens
Author: Barry Gresens
Posted: Jan 10 2008 - 05:23 PM
Subject: Possible solution
After some research, it appears the error surrounds the fact that document.body.clientWidth is an integer value. Therefore, the expression causing the error should be rewritten:

expression( document.body.clientWidth > 700 ? "700px" : document.body.clientWidth);

Doing this removes the javascript error.

Does anyone know of a way to fix this bug directly in Typo3?

-Barry Gresens
Author: Barry Gresens
Posted: Jan 10 2008 - 05:44 PM
Subject: Found solution
For those who face the same issue (it happened to me right out of the box, so I assume others will experience this), here is a solution:

The stylesheet entry comes from a setup file which actually references a Template constant for the plugin PLUGIN.TX_WECDISCUSSION_PI1. The default value for the constant is "700px" (without the quotes). This value is what appears in the stylesheet. Changing this constant to "700" fixes the problem.

To change this entry, open the root page of the website and click on Template to get the Template Tools. Then select Constant Editor, then select PLUGIN.TX_WECDISCUSSION_PI1 from the Category drop down. Change the Total Maximum Width Of Discussion Plugin field to "700" and Update. Clear the cache and refresh the page.

For those who develop and manage the Discussion Forum extension:

1. If my solution is going to cause problems elsewhere that I do not know about, please let me know!

2. Suggest updating the default value of Total Maximum Width Of Discussion Plugin to "700" or finding another way of fixing the bug.

-Barry Gresens
Author: Dave Slayback
Posted: Jan 11 2008 - 04:07 PM
Subject: re: Stylesheet javascript error
Hi Barry,

Yes this is a good fix and the right way to do it. Thanks for sharing it.

The latest unreleased version (v1.6.0) has this fix already. We have made changes in the upcoming version and hope to release it in 2 weeks.

-Dave
Total Posts: 4 - Pages (1): [1]
You must login to post a message to this conference.