Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Aujug 2020 joomla 4 workflow

38 views

Published on

One of the exciting new features of Joomla 4 is Workflows. The Joomla 4 workflow is designed for adjusting the publishing sequence for articles to include more aspects like publishing steps (think draft > editing > published) or access control for transitions (think author, editor, publisher).

During the Virtual JUG, Tim will take it one step further and combine with the power of custom fields to build a simple practical application using only core Joomla 4, with workflow to show how the new feature can be implemented for something different to a blog.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Aujug 2020 joomla 4 workflow

  1. 1. Joomla 4 Workflow By Tim Plummer Joomla Australia September 15th 2020
  2. 2. Workflow is a sequence of steps a piece of content passes from initiation to completion.
  3. 3. Joomla 3 Content Workflow Author Administrator
  4. 4. Content states in Joomla 3
  5. 5. What if we want more approval steps? Author
  6. 6. Or maybe something more complex?
  7. 7. Can’t do that in Joomla 3 But let’s see what Joomla 4 can do
  8. 8. The Publishing Workflow component is used to replace static states (unpublished, published, trashed and archived) with a more generic approach.
  9. 9. This way you can easily create a customized workflow to manage your articles within a component.
  10. 10. Terminology State/Stage– published, unpublished, trashed, archived Transitions– move one state to another
  11. 11. What if instead of content we built an app?
  12. 12. Lets do it, using only core Joomla 4 features (no third party extensions)
  13. 13. Note that Joomla 4 is still in Beta, so don’t use on live sites yet.
  14. 14. Create a new category Also set access to registered so only logged in users can fill out form.
  15. 15. Create a custom fields group
  16. 16. Just a reminder that Custom fields were added to core Joomla in version 3.7 (April 2017)
  17. 17. Make sure they are assigned to the category and field group we created Create custom fields
  18. 18. If you want to learn more about custom fields, watch August 2020 presentation with Marc Dechèvre on Joomla! Custom Fields https://www.youtube.com/watch?v=qTayrSABbpg
  19. 19. Create user groups • Create a user group for the different people who will be interacting with this workflow
  20. 20. Where is my Workflow? Out of the box, Workflow feature is turned off in Joomla 4
  21. 21. Enable Workflow feature • Content->Articles->Options->Integration->Enable Workflow
  22. 22. Now you can see Workflows under Content
  23. 23. Add a new Workflow
  24. 24. Edit the Workflow Stages
  25. 25. Rename existing Stages if required In our example, rename Basic Stage to Level 1 Helpdesk Default = initial stage
  26. 26. Add workflow Stages
  27. 27. Set up the Workflow Transitions
  28. 28. Add your Transitions • Give each a name, and decide which Stage can transition to a specific stage.
  29. 29. Add your Transitions • Set the publishing state for this transition
  30. 30. Add your Transitions • Turn on email notification (if required), and choose who it goes to
  31. 31. Add your Transitions Also decide who can move to next stage
  32. 32. Transitions • Each Workflow step should have a stage
  33. 33. Set the workflow for your category
  34. 34. Check ACL Permissions • Assign the appropriate permissions to the groups you created • Content->Categories->Support Request->Permissions
  35. 35. Check ACL Permissions
  36. 36. Article Permissions (com_content) • Adjust article permissions for your new groups (especially edit custom field value)
  37. 37. Now add a menu item for front end
  38. 38. You only see this menu item if you are logged in
  39. 39. This looks too much like an article
  40. 40. Create Override for article form in your template
  41. 41. Customise as required /yourtemplate/html/com_content/form/edit.php and customise look for this category Note this is the geeking coding bit that a regular Joomla user wouldn’t be able to do. Maybe in future there will be an easier way.
  42. 42. Create a My Support Requests view Note: You can adjust what columns you see on the List Layouts tab.
  43. 43. My Leave Applications view You could take this even further with an override and customise to include columns such as workflow state
  44. 44. The view form looks pretty ordinary
  45. 45. Override the view form with alternate layout
  46. 46. Override the view form with alternate layout /yourtemplate/html/com_content/article/default.php and rename as supportapp.php Edit as required, then assign that layout to your menu item Another geeking coding bit that a regular Joomla user may not be able to do.
  47. 47. Override the view form with alternate layout
  48. 48. You can also use Access Levels (optional) • If you want to further restrict access, use access levels which you can apply to menu item and category
  49. 49. Set up some test users Create at least one person for each role to test it out
  50. 50. Now let’s see it in action Customer creates a Support Request. It goes to Level 1 Helpdesk for review Only transition (in this case status) is to send to Level 1 Helpdesk
  51. 51. Level 1 Helpdesk step When sent to helpdesk, they can reject, escalate, complete, or request more information Note if customer logs in, they don’t see the helpdesk transition states Or if Level 2 Support logs in, they can’t reject, ask for more info or complete, they can only escalate.
  52. 52. Level 2 support step • Level 2 support can now resolve the issue and transition the next state
  53. 53. Customer confirm step • Customer can now reopen if issue is not resolved, or mark as complete.
  54. 54. Support Request Complete • No further action required, but record could be deleted or archived later if needed
  55. 55. Limitations • Can’t send transition emails to author, only groups or specific people • Need coding skills to override form and view • All the records are saved in com_content (Joomla articles) • Users can see all records in My Support Requests view, not just their own (can be fixed with layout override) • Records can get stuck “checked out” to user
  56. 56. Questions
  57. 57. Tim Plummer https://timplummer.com.au @bfsurvey

×