Tuesday, September 9, 2008

Dynamically Switching DotNetNuke StyleSheets with the Current Language

If your design requires you to embed text in an image in a multi-lingual DotNetNuke website, embed your text into images and switch them with CSS.

Simply override the styles from the base module.css stylesheet in a separate stylesheet and switch them dynamically using the following line of code directly in your skin:


<link href="<%= SkinPath %>languagespecific-<% =CType(Page, PageBase).PageCulture.Name %>.css" rel="stylesheet" type="text/css" />


This will be rendered as the filename languagespecific-en-US.css in the root of your skin for the default DNN language and switch every time the user switches their language.

Happy Nuking,

Ryan Morgan
Arrow Consulting & Design

Arrow Consulting & Design is a consulting firm based in West Palm Beach, Florida specializing in DotNetNuke, ASP.NET, SQL and WPF Development with a portfolio filled with local, national, government and global enterprise clients.

Case Studies: Click Here
Main Corporate Site: http://www.arrowdesigns.com/default.aspx?utm_source=blogspot
DotNetNuke Community Site: http://www.arrownuke.com/default.aspx?utm_source=blogspot
Consulting Inquiries: Click Here
Skin Design/Conversion: Click Here
DotNetNuke Portfolio: Click Here