The Nodes module (nodes
) introduces the Node content type to the CMS
Icybee. Most modules introducing content types inherit from it, this
includes the Contents module (contents
) as well as the Pages module module (pages
).
The module provides several classes that might be of interest if you want to write a sub-module,
although you might rather create a sub-module of the Contents module (contents
). Of course,
there if the ActiveRecord class and its model class, but also blocks, operations and a view
provider.
Updates default admin routes.
Updates default admin routes.
Register the nodes depending on the specified record. All node types are registered whatever their module (constructor).
Checks if the user being deleted is used by any node. If the user is used and error
with the uid
key is added to the error collector.
The markup creates a navigation block with links to the list, the next record and the previous record.
<p:node:navigation />
The module provides two dashboard panels. One displays a summary of the number of records per node category. The other displays a list of the last nodes updated by the user.
Node slugs are created using the slugize()
function. The default implementation uses
normalize()
, but one might want to provide a better implementation, such as one removing stop
words according the the language of the node.
The following example demonstrates how the slugize()
function could be patched to use a
remove_stop_words()
function:
<?php
Icybee\Modules\Nodes\Helpers::patch('slugize', function($str, $language=null) {
return \ICanBoogie\normalize(remove_stop_words($str, $language));
});
The package requires PHP 5.4 or later.
The recommended way to install this package is through Composer.
Create a composer.json
file and run php composer.phar install
command to install it:
{
"minimum-stability": "dev",
"require":
{
"icybee/module-nodes": "2.x"
}
}
This package is part of the packages required by Icybee.
The package is available on GitHub, its repository can be cloned with the following command line:
$ git clone git://github.com/Icybee/module-nodes.git nodes
The package is documented as part of the Icybee CMS
documentation. The documentation for the package and its
dependencies can be generated with the make doc
command. The documentation is generated in
the docs
directory using ApiGen. The package directory can later by
cleaned with the make clean
command.
The test suite is ran with the make test
command. Composer is
automatically installed as well as all the dependencies required to run the suite. The package
directory can later be cleaned with the make clean
command.
The package is continuously tested by Travis CI.
This package is licensed under the New BSD License - See the LICENSE file for details.