Content parser and editor management

This page is not translated yet. Showing original version of page. You can sign up and help with translating.

Since version 0.9.3 Cotonti supports multiple parsers and editors on site which can be simply installed as plugins. This document shortly describes how to manage them.

#1. Choosing a parser

First thing you need to do to use some parser is to install an appropriate plugin. For example, to use HTML parsing you need to install "html" plugin or to use BBcodes on your site you need to install "bbcode" plugin. Installing a parser plugin does not change anything in your site, it just enables the parser for further use.

To choose a global parser for entire site go to Administration => Configuration => Main Settings and change the Markup parser there. This will be the default one. Page module has its own separate parser choice in Administration => Configuration => page. You can also choose a parser for a specific page with a Parser dropdown when adding/editing a page. Changing a parser does not modify the contents itself, that should be done manually or with a conversion tool (see below).

If no parser is installed or chosen, site contents is be displayed as plain text.

Module and plugin developers can implement their own parser choice, all they need to do is to fill the $sys['parser'] global variable with current parser name and pass it as 3rd parameter to cot_parse() function. To implement your own parser, you need to create a plugin (e.g. markleft) and put a parser function (e.g. cot_parser_markleft()) to a plugin part with Hooks=parser.

#2. Choosing an editor

Each parser can be associated with its own editor. After you have installed an editor plugin, go to Administration => Configuration => [parser plugin] and pick a suitable editor there.

In order for editors to work, your theme's footer.tpl must contain {FOOTER_RC} tag.

Editor plugins are implemented using Hooks=editor. For example have a look at markitup or ckeditor plugin source.

#3. Converting BBcode to HTML

This section mostly covers sites migrated from Cotonti Genoa and Seditio. In Siena versions prior to 0.9.3 the entire site was either left in bbcode or converted to HTML automatically depending on your choice upon upgrade. Since 0.9.3 no automatic conversion is done upon upgrade, but you can convert BBcode to HTML afterwards any time you wish.

To do so go to Administration => Other => Plugins => BBcode Parser (bbcode plugin is required). At the bottom of the page you will see links which convert appropriate parts of your site to HTML. It is not recommended to convert the same part more than once. Backup your database before using this conversion feature.

1. Areal  2011-08-12 07:12


Sadece kayıtlı kullanıcılar yeni yorum yapabilir.