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.

Joomla 4 custom fields and workflow

427 views

Published on

Presented at JoomlaDay Australia Brisbane 2019.
Learn how to leverage the core Joomla 4 features of workflows and custom fields to build simple applications, without having to be a coding geek. While custom fields have been in Joomla core for a couple of years, they become so much more powerful once you combine them with the new Joomla 4 workflows feature. We'll take a look at how it all works and give you some ideas about what you can create on your own Joomla sites.

Published in: Software
  • Be the first to comment

  • Be the first to like this

Joomla 4 custom fields and workflow

  1. 1. Joomla 4 Custom Fields and Workflow By Tim Plummer JoomlaDay Australia Brisbane 2019 August 3rd 2019
  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? WorkflowForm Create a leave request
  12. 12. Lets do it, using only core Joomla 4 features
  13. 13. Note that Joomla 4 is still in Alpha, so don’t use on live sites yet.
  14. 14. Create a new category
  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 specific category Create a custom fields
  18. 18. Create user groups • Create a user group for the different people who will be interacting with this workflow Create a leave request
  19. 19. Enable Email Notifications System->Manage->Plugins->Content – Joomla plugin
  20. 20. Add a new Workflow
  21. 21. Edit the Workflow Stages
  22. 22. Rename existing Stages if required In our example, rename Unpublished to Rejected Rename Published to Completed, and delete Trashed and Archive Create a leave request
  23. 23. Add new workflow Stages • Also set default (initial stage) Create a leave request
  24. 24. Set up the Workflow Transitions Create a leave request
  25. 25. Add your Transitions • Give each a name, and decide which Stage can transition to a specific stage. Also decide who can move to next stage Create a leave request
  26. 26. Transitions • Each Workflow step should have a stage Create a leave request
  27. 27. Check ACL Permissions • Assign the appropriate permissions to the groups you created • Content->Categories->Leave Application Form->Permissions
  28. 28. Article Permissions (com_content) • Adjust article permissions for your new groups (especially edit custom field value)
  29. 29. Now a menu item for front end
  30. 30. You only see this menu item if you are logged in
  31. 31. This looks too much like an article still
  32. 32. Override edit form Copy /components/com_content/tmpl/form/edit.php to /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.
  33. 33. Create a My Approvals view Note: You can adjust what columns you see on the List Layouts tab. Note: We actually create this access level in a couple of slides time.
  34. 34. My Leave Applications view You could take this even further with an override and customise to include columns such as workflow state
  35. 35. The view form looks pretty ordinary
  36. 36. Override the view form with alternate layout • You can clean up and simply the view form with an alternate layout Copy /components/com_content/tmpl/article/default.php to /yourtemplate/html/com_content/article/default.php and rename as leaveapplication.php Edit as required, then assign that layout to your menu item Another geeking coding bit that a regular Joomla user wouldn’t be able to do.
  37. 37. 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
  38. 38. Now let’s see it in action • Employee creates a leave request. It goes to manager approval Create a leave request
  39. 39. Manager approval step • When sent to manager, he can reject, approve, or request more information • Note if employee logs in, they don’t see the manager action transition states Create a leave request
  40. 40. Payroll process step • Payroll can now transition the state Create a leave request
  41. 41. Leave request is now complete There are no more transitional states for this workflow Create a leave request
  42. 42. Limitations • Can’t customise transition emails • Everyone with “Execute Transition” permission will get the email • Need coding skills to override form and view • All the records are saved in com_content (Joomla articles)
  43. 43. We probably don’t have time for Questions • Feel free to come and chat with me during one of the breaks or at the social event. I’ll be around all weekend.
  44. 44. One more thing….
  45. 45. Most open source projects have a mascot but Joomla doesn’t 
  46. 46. Disclaimer This is not affiliated with or endorsed by Open Source Matters or the Joomla Project
  47. 47. Find out more at https://timplummer.com.au/jambo The new unofficial Joomla Mascot My free gift to the Joomla Community
  48. 48. Tim Plummer https://timplummer.com.au @bfsurvey

×