This project is read-only.

How to display custom workflow activity stylesheet?

Topics: Customizing Orchard, Writing modules
Jul 19, 2013 at 5:57 PM
I'm not sure if this is an issue or a lack of knowledge, but when I create a custom workflow activity in a separate module I don't know how to get the workflow module to include my custom stylesheet that is in my module in the list of stylesheets it loads to display toolbox and canvas icons, etc.

I can add the stylesheet to a resource manifest in my module, but how does the workflow module know to add it to the page when it displays the activity in the toolbox, etc.? As far as I know it doesn't use any kind of self-discovery as the stylesheets for the built-in activities are hand-coded in its resource manifest.

I can, of course, apply a bandaid and add it manually to the Workflow's Resource Manifest file, but that is not ideal for obvious reasons.

Does anyone have a solution or can confirm this is an issue? I thought it may be an issue, but wanted to ask here first just to confirm before logging it.

Thanks for the help. Have a great weekend!


Jul 22, 2013 at 8:09 PM
Neither seems like an ideal solution but you could include your stylesheet through the resource manager from:
  • An action filter, checking for the respective action(s) (Edit() most of the time) of Workflows AdminController
  • The form provider if you activity displays a form (would only be included for the page the form is displayed on of course)
  • The display event of the Edit shape (I'm really not sure about that; most possibly this view doesn't go through the Orchard shape display pipeline, as it's just a regular view).
  • The Category property of your activity as this will be accessed when listing it (this is simple but very dirty)
Jul 23, 2013 at 3:58 AM
Thank you for the suggestions!

I implemented a custom interface for my activities and then overrode the ActivityToolbox shape in my theme to solve the problem. It works well, but this shouldn't be needed. I think it is definitely an oversight and will log it as an issue.