Closed avpaderno closed 1 year ago
@kiamlaluno thanks for all your work on this and other Examples. I like this update from the outdated and cumbersome "nodeapi" phrasing. But I notice the content type example should be node_content_type_example
instead of node_content_type
, to match all the other Example modules, which all end with "_example". Was this an oversight? Sorry to bring this up after its merged.
I wanted to avoid a longer machine name, but I guess that 7 characters do not make much a difference.
In that case, I was actually thinking that "node" and "content" mean the same thing in our context, so maybe node_type_example
?
Yes, either that or content_type_example
, as content type is the phrase used to mean a node bundle.
I will update the PR between 2 hours, less or more. I already changed the local repository copy, but I used node_content_example
as module machine name; I will need to change the module files again.
node_bundle_example
is also a possibility, which at least makes clear to which core module the example is related.
I think node_type_example
matches best with the other 3 node_***
modules. Novice users to Backdrop may not realise content_type_example
is related to those.
node_bundle_example is also a possibility, which at least makes clear to which core module the example is related.
I think "type" is clearer than "bundle" for an Example module.
The _nodeexample module shows how to create a custom content type; by its name, it could seem an example on how to use the functions from the Node module.
The _nodeapiexample module shows implementations of hooks invoked by the Node module; by its name, it could seem an example on how to use the Node module API.
The _nodeexample module should be renamed to (for example) _custom_content_typeexample; the _nodeapiexample module should be renamed to (for example) _node_hooksexample.
I am postponing this task, as I prefer doing other changes, before renaming modules.