Hello,
I was thinking that some modules use custom fields.
The problem is that they could conflict with already existing fields on the site.
example:
you module wants to use a field named "category", but the site already stores a "category" field
that has a different implementation, other field type, etc.
The solution I think is simple, just add a prefix to the fields that the module uses.
three letters and a underscore before the field name.
example
cls_category
But its prettier to call
"$module->category" than "$module->cls_category"
This will be solved using a simple module just for hooks
that is installed alongside our module.
$wire->addHookProperty("Page(template=cls_mymodule)::category", function(HookEvent $event){
$page = $event->object;
return $event->return = $page->cls_category;
});
We are adding a property hook that simplifies the field name. This way it can be called like $module->category
also the template names are prefixed.
Please tell me if there are other ways
thanks.