backdrop-contrib / examples

Examples for Developers
GNU General Public License v2.0
7 stars 9 forks source link

Rename the node_example and the nodeapi_example modules #74

Closed avpaderno closed 1 year ago

avpaderno commented 1 year ago

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.

docwilmot commented 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.

avpaderno commented 1 year ago

I wanted to avoid a longer machine name, but I guess that 7 characters do not make much a difference.

docwilmot commented 1 year ago

In that case, I was actually thinking that "node" and "content" mean the same thing in our context, so maybe node_type_example?

avpaderno commented 1 year ago

Yes, either that or content_type_example, as content type is the phrase used to mean a node bundle.

avpaderno commented 1 year ago

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.

avpaderno commented 1 year ago

node_bundle_example is also a possibility, which at least makes clear to which core module the example is related.

docwilmot commented 1 year ago

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.