Win a copy of Pro Spring MVC with WebFlux: Web Development in Spring Framework 5 and Spring Boot 2 this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

Admin theme (kind of...)

 
Ranch Hand
Posts: 41
10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).
 
author & internet detective
Posts: 40552
825
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic