File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JForum and the fly likes Admin theme (kind of...) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JForum
Bookmark "Admin theme (kind of...)" Watch "Admin theme (kind of...)" New topic
Author

Admin theme (kind of...)

robert crowther
Ranch Hand

Joined: Oct 19, 2013
Posts: 41
    
  10
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
internet detective
Marshal

Joined: May 26, 2003
Posts: 30537
    
150

Cool! I gave you a cow for sharing this.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
robert crowther
Ranch Hand

Joined: Oct 19, 2013
Posts: 41
    
  10
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Admin theme (kind of...)