Wednesday, September 29, 2010

PDF File Fails to Display Correctly

The Problem:

In IE7, when you click on the PDF icon, PDF file fails to display correctly. The pop-up window is empty.


The Remedy:


1. Download this file: browser_detection.zip.


2. Extract the zip file.


3. Upload browser_detection.php to the folder libraries/joomla/utilities/ of your site.


4. Find the file icon.php in the folder components/com_content/helpers/.


5. Edit icon.php as follows:


In line 1, after the <?php tag, type in the following code:
require_once("libraries/joomla/utilities/browser_detection.php");

It becomes:
<?php require_once("libraries/joomla/utilities/browser_detection.php");

Search for the following code somewhere in line 60:
$attribs['onclick'] = "window.open(this.href,'win2','".$status."'); return false;";

Replace the line with the following code:

$user_browser = browser_detection('browser');
if ($user_browser == 'msie7') {
$attribs['target'] = '_blank';
} else {
$attribs['onclick'] =
"window.open(this.href,'win2','".$status."'); return false;";
}

6. Save and upload the file to components/com_content/helpers/.

Note: You may need to clear your cache before you can see the PDF working.

Joomla Resources:
The easiest, fastest way to learn Joomla.
Publish a magazine with Joomla.
SEO Club.
Joomla! Extensions Directory.

No comments:

Post a Comment