Download the PHP package locomotivemtl/charcoal-contrib-sitemap without Composer
On this page you can find all versions of the php package locomotivemtl/charcoal-contrib-sitemap. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download locomotivemtl/charcoal-contrib-sitemap
More information about locomotivemtl/charcoal-contrib-sitemap
Files in locomotivemtl/charcoal-contrib-sitemap
Package charcoal-contrib-sitemap
Short Description Charcoal service for generating a sitemap.
License MIT
Homepage https://locomotivemtl.github.io/charcoal-contrib-sitemap/
Informations about the package charcoal-contrib-sitemap
Charcoal Sitemap
A Charcoal service for generating a sitemap.
Table of Contents
- Installation
- Dependencies
- Service Provider
- Services
- Configuration
- Usage
- Using the builder
- Sitemap.xml
- Development
- Development Dependencies
- Coding Style
- Credits
- License
Installation
The preferred (and only supported) method is with Composer:
Dependencies
Required
- PHP 5.6+: PHP 7 is recommended.
- locomotivemtl/charcoal-app: ^0.8
- locomotivemtl/charcoal-core: ^0.3
- locomotivemtl/charcoal-factory: ^0.4
- locomotivemtl/charcoal-object: ^0.4
- locomotivemtl/charcoal-translator: ^0.3
Service Provider
Services
- charcoal/sitemap/builder Instance of
Charcoal\Sitemap\Service\Builder
. Used to generate collections of links from the configured models.
Configuration
The Sitemap can be configured from the application configset under the
sitemap
key. You can setup which objects to be included and available
translations (l10n).
Most options are renderable by objects using your application's chosen template syntax (Mustache used in examples below).
Default Options
json
- "
": { - "property": "active",
- "value": true
- }
- json
- "
": { - "property": "position",
- "direction": "ASC"
- }
Each model can override the following options of their group:
l10n
, locale
, check_active_routes
, relative_urls
.
Example
The example below, identified as footer_sitemap
, is marked as multilingual
using the l10n
option which will include all translations.
Usage
Using the builder
The builder returns only an array. You need to make your own conversation if you need another format.
The Sitemap module will include all necessary service providers and set the route (sitemap.xml) directly. Include the module:
Given the settings above:
You can also use the SitemapBuilderAwareTrait
, which includes the setter and getter for the sitemap builder, in order
to use it with minimal code in every necessary class.
Sitemap.xml
This contrib provides a route for sitemap.xml
that dynamically loads the xml
config and outputs it
as an XML for crawlers to read.
Development
To install the development environment:
To run the scripts (phplint, phpcs, and phpunit):
API Documentation
- The auto-generated
phpDocumentor
API documentation is available at:
https://locomotivemtl.github.io/charcoal-contrib-sitemap/docs/master/ - The auto-generated
apigen
API documentation is available at:
https://codedoc.pub/locomotivemtl/charcoal-contrib-sitemap/master/
Development Dependencies
Coding Style
The charcoal-contrib-sitemap module follows the Charcoal coding-style:
- PSR-1
- PSR-2
- PSR-4, autoloading is therefore provided by Composer.
- phpDocumentor comments.
- .editorconfig for coding standards.
Coding style validation / enforcement can be performed with
composer phpcs
. An auto-fixer is also available withcomposer phpcbf
.
Credits
License
Charcoal is licensed under the MIT license. See LICENSE for details.
All versions of charcoal-contrib-sitemap with dependencies
locomotivemtl/charcoal-app Version ~0.8
locomotivemtl/charcoal-core Version ~0.3
locomotivemtl/charcoal-factory Version ~0.4
locomotivemtl/charcoal-object Version ~0.4
locomotivemtl/charcoal-translator Version ~0.3
locomotivemtl/charcoal-view Version ~0.3