By modifying just one FileMaker script, you can add CSS specific to certain users or privilege sets. Use this to…
- Swap out or remove buttons
- Show or hide different calendar views
- Show or hide individual fields in an event
- Add icons for certain event statuses
- Show or hide help icons
- Code examples for all of these, and more, are here.
Edit the script “Export Theme ({Preview})” and in the Else branch, replace the single ExportFieldContents line with lines 22 through 31 in the screenshot below. 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.)
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:
// 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 lines which reference the CalendarInterface::ExportGlob. You’ll find examples of some common CSS changes here: customizing DayBack’s CSS.
Note that the script above 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.
Enjoy!