Happy to share that the Template module we have been working on is ready for review and testing!
Note: This module is not ready for production! Please do not install it on your production farmOS instances. I expect there to be a few more breaking changes as we test things out.
Iāve prepared some documentation (still a wip): Farm Template
To test, you can use the farmOS demo site. First enable the farm_template module from the setup page and then go to Setup ā Templates to get started
This module provides a new concept of templates for use within farmOS. Templates make it faster and easier to create consistent Asset and Log records that follow a standard data convention. The goal is that no code is required - you can build templates via the UI specific to your data needs and use-case. In some ways this is also like ābuilding a quick formā for simple asset + log records.
Iāve put a lot of thought into the structure of this base template config entity. You can use the template by itself to create records but things get more exciting as you use the same template in other placesā¦ for this scope of work we have two things in the works:
Create quick forms from a template and further configure the quick form with overridden default values for that specified template. This allows you to re-use templates multiple times but hard-code specific values to make quick forms even more streamlined. This is done and needs to be tested!
Use templates in plans. The idea is that you want to configure a plan at the beginning of the year with various templates for the actions to take throughout the year, perhaps on a recurring schedule. The plan will house the templates/logs and track progress. Templates can be re-used across plans. Some of this is implemented but needs more work
Iām excited and curious to hear about other ways that templates can be usedā¦ a couple I have in mind:
Use templates via the API to build mobile frontends for very quick, custom data entry
Create a data stream notification plugin that submits a template when certain conditions are met. Eg: auto-create an activity log when the weather gets bad
Iāll use this thread to post updates over the next few weeks as I continue to work through these last features. Let me know if you are able to test and have any feedback. Iām also tracking issues and tasks for this module on the drupal project page: https://www.drupal.org/project/farm_template
Thanks for testing @BOTLFarm@pat ! Iāll make another release with various bug fixes and minor improvements this week.
Yes that would be niceā¦ quantities just are a little tricky because they are an entity with their own set of fields. Iāll need to figure out something similar for inventory quantities so you can select an existing asset to update inventory for.
Weāre still too early! Please donāt use this in production yet! (Iāll update the thread above. Module releases say this too!)
Very interestingā¦ I agree that would be nice. I had thought of something similar but donāt think we can do it in this first version. Nice to know it would be useful!
Drupal has a concept of āTokensā that act as placeholders you can place within text strings. When the text strings are processed the tokens get replaced with their respective values. For example:
title = ":asset:name , harvested :harvest_quantity:value eggs"
I think this could be a nice way to implement this kind of feature. There is often a little UI that shows the tokens āavailable for replacementā but still, it definitely requires some advanced understanding of what is going on.
Iāve been playing some more with this. Only on demo-instance so no real testing. But Iād say itās one of the most important module for farmOS ever. It really makes farmOS alot better for entering data.
This will make data entry in the field so much easier and more streamlined for my specific farm needs! Iāve been excited about this for a while and enjoyed checking it out - it looks great. Canāt wait to use it for real! -Jess