Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Admin theme (kind of...)

 
robert crowther
Ranch Hand
Posts: 41
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just discovered I could do this, which helps.

See,

templates/someTheme/admin//..

It's nearly self-contained, with it's own image folder, etc.

So, copy the default styles.css into a subfolder in there e.g.

templates/someTheme/admin/styles/style.css

Then change,

templates/someTheme/admin/header.htm

removing the old styles.css file code in favour of (I added the -admin prefix to the file to remind me what it's for),

<link rel="stylesheet" type="text/css" href="${contextPath}/templates/${templateName}/admin/styles/style-admin.css" />

Good. Now the admin is near self-contained (images use url() addressing), and will be in default style. And you can hack away at the upper level templates and stylesheet as you wish (without crippling admin). This is not a complete defence, there are a few other links, and don't, ever delete JForum supplied images, or the admin pages will go for a walk.

Still, glad I figured this when I did (a couple of hours ago).
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34839
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cool! I gave you a cow for sharing this.
 
robert crowther
Ranch Hand
Posts: 41
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey, thanks. And me a Limey - thats alright

I pushed this a little and found table styling does mess the admin display. I figure table styling is very likely, so here's revised instructions,

1 (as above) Use a clean default styles.css sheet, put it in a subfolder of admin, and point the main header at it.
2 Also, point (both in /admin) menu.htm and admin_welcome.htm at the /admin/style.css.

And that should do it. I suppose you could refactor completely, for complete sandboxing (of an admin theme), but the above should cover most theme styling activity.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic