DNN Forums

Ask questions about your website to get help learning DNN and help resolve issues.

Attach Stylesheet to Page

 5 Replies
 3 Subscribed to this topic
 19 Subscribed to this forum
Sort:
Author
Messages
Growing Member
Posts: 33
Growing Member
New Poster
New Poster
Congrats on posting!

Does anyone attach stylesheets to pages using the field in the Advanced > Appearance tab of page settings? 

I've never been able to get it to work and would appreciate any guidance, if you do this. We're on DNN 9.3. Thank you. 

John 

Veteran Member
Posts: 838
Veteran Member
3 Helpful Replier
Helpful Replier
Thanks for being such a helpful replier!
New Poster
New Poster
Congrats on posting!

No, if I want to divert from the standard, I allocate a different layout to the page. Otherwise it gets a bit messy in my opinion. The next day you already forgot why the layout is no what you expect...

Having said that: it is quite easy to use. The trick is that the css file needs to be in the same site/portal. So, if the default is https://www.yoursite.com/...ourskin/global-4.css you fill in the text field https://www.yoursite.com/...ourskin/diverted.css for instance. So, just the url. No import or something.

Senior Member
Posts: 1607
Senior Member
MVP
MVP
You're an MVP!
New Poster
New Poster
Congrats on posting!

I haven't used this setting myself, but if I remember correctly, the CSS file path you put into that field needs to be relative to the root folder where the theme files live.  

So, an example of <code>MyStyles.css</code> would probably need to be in the folder below, where <code>THEME-NAME</code> is the name of your actual theme (and folder).  

<code>/Portals/_default/THEME-NAME/MyStyles.css</code>

... or (if installed to a specific portal, where <code>###</code> is a valid portal ID) ... 

<code>/Portals/###/THEME-NAME/MyStyles.css</code>

Growing Member
Posts: 33
Growing Member
New Poster
New Poster
Congrats on posting!
Thanks, guys. The help popup with the field says to put the CSS in the root or a root subfolder of the site, which I assume means portal. I've tried that and the CSS is not found.

Tycho, we have a mobile app for which we supply several reworked pages from our site. A template helps, but the app look is completely different - fonts, colors, everything. I considered using the custom stylesheet but would rather have a separate sheet.

John
Growing Member
Posts: 33
Growing Member
New Poster
New Poster
Congrats on posting!
Will, I reread you post and am not sure I tried that. Will give it a go. Thanks.

John
Growing Member
Posts: 45
Growing Member

You can use this CSS style if you want to place a special CSS file for a specific page.

You can upload the file under /Portals/0/home.css 

Mentioned only home.css in page stylesheet section under the Advanced > Appearance tab of page settings  

3ART TechnologiesRegards,
3ART Technologies Expert

3ART Technologies
Experts in Analysis, Design & Development for DNN and SharePoint Solution
https://www.3art.tech/

These Forums are for the discussion of the open source CMS DNN platform and ecosystem.

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

  1. If you have (suspected) security issues, please DO NOT post them in the forums but instead follow the official DNN security policy
  2. No Advertising. This includes the promotion of commercial and non-commercial products or services which are not directly related to DNN.
  3. 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.
  4. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  5. No Flaming or Trolling.
  6. No Profanity, Racism, or Prejudice.
  7. Site Moderators have the final word on approving / removing a thread or post or comment.
  8. English language posting only, please.

Would you like to help us?

Awesome! Simply post in the forums using the link below and we'll get you started.

Get Involved