Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Styles skinobject (media attribute)Styles skinobject (media attribute)
Previous
 
Next
New Post
4/16/2009 5:49 AM
 

Hi,

I was creating a skin for a portal that has a print icon over all pages. this print icon is configured with a link that call javascript function to print the current page. the htmler gave me 2 css files as one for main render and the second is for printable version and he assigned each link tag with media attripute. i was so happy to see that DotNetNuke has a styles skin object  <dnn:STYLES .... ./>  which we can use after registering that skinobject using the file "~/Admin/Skins/Styles.ascx"

but i noticed that it hasn't the attribute Media, it has all the other attributes and the IE conditions also. but it hasn't the Media attribute that could allow me to specify the media type of the related css file. if its for Screen, Print, etc...

so i thought to add it and here are the few lines that i ultered that styles skinobject vb file with :
file path : ~/Admin/Skins/Styles.ascx.vb

at the Fields region you can add

Private _media As String
 

Then adding the Media property  as:

 Public Property Media() As String
            Get
                Return _media
            End Get
            Set(ByVal value As String)
                _media = value
            End Set
End Property

 

and in AddStyleSheet() function you can add

        If Not Media Is String.Empty Then
                        objLink.Attributes("Media") = Media
         End If

right after the existing line   

objLink.Href = skinpath + StyleSheet

 

thats will allow you to use Media property in the skin as following

 dnn:STYLES runat="server" ID="StylesPrint" Name="printCss" media="print" StyleSheet="css/print.css" UseSkinPath="true" />

Hope that will help you in case you have similar case

 

regards

 

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Styles skinobject (media attribute)Styles skinobject (media attribute)


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out