Posted By


inreflection7 on 08/05/11

Tagged


Statistics


Viewed 645 times
Favorited by 0 user(s)

Kentic - CMSDesk CSS


/ Published in: C#
Save to your folder(s)

Sometimes things look terrible in CMSDesk. With just a few adjustments to the master page and its CS file you can target elements in an admin.css page.


Copy this code and paste it in your HTML
  1. // Put this line in your <head> of the master page
  2.  
  3. <link rel="Stylesheet" href="~/App_Atom/Admin/css/admin.css" runat="server" id="CMS_CSS" visible="false" />
  4.  
  5. // Put this in the Master CS file
  6.  
  7. using System;
  8. using System.Data;
  9. using System.Configuration;
  10. using System.Collections;
  11. using System.Web;
  12. using System.Web.Security;
  13. using System.Web.UI;
  14. using System.Web.UI.WebControls;
  15. using System.Web.UI.WebControls.WebParts;
  16. using System.Web.UI.HtmlControls;
  17. using CMS.CMSHelper;
  18. using CMS.UIControls;
  19. using CMS.PortalEngine;
  20.  
  21. public partial class App_Atom_MasterPages_Default : TemplateMasterPage
  22. {
  23. protected void Page_Load(object sender, EventArgs e)
  24. {
  25. CheckForEditMode();
  26. }
  27. // If in Kentico Edit Mode
  28. private void CheckForEditMode()
  29. {
  30. if (CMSContext.ViewMode.Equals(ViewModeEnum.Edit))
  31. //Load Custom Admin CSS
  32. //linkCmsCss.Visible = true;
  33. CMS_CSS.Visible = true;
  34. }
  35.  
  36. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.