backdrop-contrib / examples

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

Update the description given for the node_example group #68

Closed avpaderno closed 1 year ago

avpaderno commented 1 year ago

The Example: Node module contains the following comment as description for the node_example group.

/**
 * @defgroup node_example Example: Node
 * @ingroup examples
 * @{
 * Example defining a node type in code.
 *
 * This is an example outlining how a module can be used to define a new
 * node type. Our example node type will allow users to specify multiple
 * "colors", a "quantity" and an "image" for their nodes; some kind of
 * rudimentary inventory-tracking system, perhaps?
 *
 * The basic pattern for defining a node type is to tell Backdrop about the
 * node's fields and view modes. Backdrop will then take over and manage
 * the storage for this node type.
 *
 * Remember that most node types do not require any custom code, as one
 * simply creates them using the Backdrop user interface. Creating a node like
 * this in code is a special case.
 *
 * At absolute minimum, in order to provide a content type for
 * node, you have to implement hook_node_info() and hook_form().
 * Node can take care of the rest, if you want it to.
 *
 * First and foremost, defining a node type happens in
 * hook_node_info(). Our implementation of this hook gives
 * Backdrop an array of information about the content type
 * we want to create.
 *
 * Next, since we want to add fields to our content type, we
 * implement hook_node_type_insert(), which gives us a chance
 * to modify recently-created content types.
 *
 * Backdrop is able to handle deletion of our content, including
 * dependencies based on re-use of our field instances, so we don't
 * have to manage any of it.
 *
 * Consult the @link http://DOCUMENTATION_PENDING Field API Tutorial @endlink
 * and @link http://DOCUMENTATION_PENDING Field API Handbook Page @endlink
 * and @link field Field API documentation @endlink.
 *
 * @see field_example.module
 */

hook_node_info() is not used from Backdrop, which moved node type and field definitions to CMI. hook_node_type_insert() is still used, so that part is still correct.

No example module implements hook_node_info(); only that comment needs to be fixed.