Page 1 of 1

Load/change themes based on different login.

PostPosted: Fri Sep 21, 2018 5:11 am
by Kolbeinn
Hi,

Is it possible to load different theme based on login at startup or is it possilbe to do it in the ccs file.

The reason for this is I need to have different look between users.

Few things I want to have different for one user but others can be standard.
1. Remove the green + sign.
2. Remove the yellow background when you look at the current date.
3. Remove the refresh and date selection arrows.

Best regards,
Kolbeinn.

Re: Load/change themes based on different login.

PostPosted: Fri Sep 21, 2018 6:11 am
by John Sindelar
Hi Kolbeinn,

I believe we've got a way to change the CSS on startup for each user. I'll ask around and get back to you.

Thanks!

- John

Re: Load/change themes based on different login.

PostPosted: Fri Sep 21, 2018 6:57 am
by John Sindelar
Here's how you can change the CSS for each user. This only runs at startup, so if you are having users log in and out of your solution after startup, you'll want to run DayBack's "Upon Opening" script after each login change.

Edit the script "Export Theme ({Preview})" and in the Else branch, replace the single ExportFieldContents line with lines 22 through 31 in the attached screenshot. You'll see just a single branch here for the user "Bob", but change that to "=" and you can create a separate branch for each user who needs special CSS. (Click on the image for a larger version.)

Image

Line 25, which you can't really read in the screenshot, is where you actually add new CSS. Here is the second part of the SetField dialog and the example here just turns off the green plus button:

Code: Select all
// Hide the plus button for new events

".add-event-container {
display: none !important;
}"

& ¶ &

// Hide the "new event" popover button

"div[content=newEvent]{
display: none !important;
}"

& ¶ &

CalendarInterface::ExportGlob


Don't forget to include the regular CSS at the end in the last two line which reference the CalendarInterface::ExportGlob.

If you want to make more customizations, you'll find lots of CSS examples here: http://www.seedcode.com/pmwiki/pmwiki.p ... eMaker.CSS

Hope that helps!

- John

Re: Load/change themes based on different login.

PostPosted: Mon Sep 24, 2018 1:38 am
by Kolbeinn
Brilliant, thank you I will try this.

Best regards,
Kolbeinn.

Re: Load/change themes based on different login.

PostPosted: Mon Sep 24, 2018 2:23 am
by Kolbeinn
Tested and it worked!

Best regards,
Kolbeinn.

Re: Load/change themes based on different login.

PostPosted: Mon Sep 24, 2018 6:41 am
by John Sindelar
That's great, Kolbeinn! Well done! And thanks for letting us know.

- John