Showing posts with label dotnetnuke skin conversion. Show all posts
Showing posts with label dotnetnuke skin conversion. Show all posts

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

Saturday, August 16, 2008

Hiding Sections from Unauthenticated Users in DotNetNuke Skins and DNN Skin Conversions

A lot of times, when creating a DotNetNuke skin, I find the need to hide a certain link, text or skinobject in my dnn skin to users that are not logged in. There is a super-simple way to do this, if you add in a little server side code into your skin conversion.

For this example, I wanted to hide the User DotNetNuke skin object. This is for an e-commerce website, so it made sense to only have users register during the checkout process and hide the "Register" link that shows up to unauthenticated users.

<% If Request.IsAuthenticated Then%>
<%dnn:user id="dnUser" runat="server"%>
<%% End If%%>

The way this works is that anything within that server-side if statement is displayed at runtime if the user is logged in.

You could also switch it so that you have a section that only shows up in your skin if the user if not authenticated by changing it to

<% If Not Request.IsAuthenticated Then%>
<%span class="NormalRed"%> You're Not Logged In!<%/span%>
<%% End If%%>

If you're interested in creating custom role access for sections of skins, checkout my last blog post here: http://dotnetnuke-skin.blogspot.com/2008/08/creating-custom-role-to-display-admin.html

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