Saturday, January 22, 2011

Messages For upgrade Browsers in Liferay

This code will be help to
Step1. Add these lines in main.js under this path your_theme/docroot/_diff/js

// java Scipt for Massage upgrade Browsers this is effect < IE7
jQuery(document).ready(function(){
if (Liferay.Browser.isIe() && Liferay.Browser.getMajorVersion() < 7) {
document.getElementById("iepop").style.display='block';
}});

Step 2. Add these lines into portal_normal.vm under this path your_theme/docroot/_diff/templates. You could changes path and name as per your requirement.

<div id="iepop" style="display:none;">
<table>
<tr>
<td>
<span>
We no longer support your browser. Use a modern browser like <br>
And also latest Version of all browser like
<a href="http://www.opera.com"><img src="$images_folder/op.png" width="20px"/></a>
<a href="http://www.safari.com"><img src="$images_folder/sf.png" width="20px"/></a>
</span>
</td>
<td>
<a href="http://www.microsoft.com/windows/internet-explorer/default.aspx"><img src="$images_folder/ie.png"/></a>
<a href="http://www.mozilla.com/en-US/"><img src="$images_folder/ff.png"/></a>
<a href="http://www.google.com/chrome"><img src="$images_folder/gc.png"/></a>
</td>
</tr>
</table>
</div>

Step 3. Add images under these path your_theme/docroot/_diff/images.

op.png
sf.png
ff.png
gc.png
ie.png

Step 4. Add these lines into custom.css under this path your_theme/docroot/_diff/css.

/************** Less Than ie6 browsers alert massage ************/
#iepop {
background:#297BCC;
height:50px;
width:100%;
}
#iepop span {
color:#FFF;
font-weight:bold;
font-size:13px;
}
#iepop span img {
width:20px;
}

No comments:

Post a Comment