Coco_XH - a CMSimple_XH Plugin

Coco_XH facilitates to have an arbitrary amount of so called co-contents on your website. These are similar to newsboxes, but instead have different content for every page. Coco_XH is inspired by the Also plugin, but (for CMSimple_XH ≥ 1.5 only) allows editing with the chosen editor instead of a textarea and scripting to be used.

Please do read this documentation, before you encounter any problems!

Important Notice

Coco_XH couldn't be tested so far in various environments. It is a so called Release Candidate. Use with caution!

Requirements

Coco_XH is a plugin for CMSimple_XH ≥ 1.2. It requires a UTF-8 encoded version.

Installation

The installation is done as with many other CMSimple_XH plugins. See the CMSimple_XH wiki for further details.

  1. Backup the data on your server.
  2. Unzip the distribution on your computer.
  3. Upload the whole directory coco/ to your server into CMSimple_XH's plugins directory.
  4. Set write permissions to the subdirectories config/, css/, languages/ and the plugin's data folder.
  5. Protect Coco_XH's data folder against direct access by any means your webserver provides. An .htaccess file for Apache servers is already distributed in the default data folder.
  6. Switch to "Coco" in the back-end to check if all requirements are fulfilled.

Settings

The plugin's configuration is done as with many other CMSimple_XH plugins in the website's back-end. Select "Coco" from "Plugins".

You can change the default settings of Coco_XH in "Plugin Config". Hints for the options will be displayed when hovering over the help icon with your mouse.

Localization is done in "Plugin Language". You can translate the character strings to your own language, or customize them according to your needs.

The look of the Coco_XH can be customized in "Plugin Stylesheet". This is mainly meant for styling the back-end. The styling of the co-content should be done by modifying the template and its stylesheet.

Usage

To have co-content on your site, just insert in your template

<?php echo coco('my_content');?>

in the place where you want, e.g. instead of a newsbox. Instead of 'my_content' you can choose any name, as long as it consists of lower-case letters (a-z), digits and underscores only. You can have as many co-contents as you like, as long as you give them different names.

The screenshot shows two co-contents:

view-mode

If you are in edit mode, you can edit the co-content, either with a textarea or from CMSimple_XH 1.5 on with the configured editor. Note that tinyMCE for CMSimple_XH 1.0 (shipped with CMSimple_XH 1.5 and 1.5.1) doesn't work with Coco_XH, so you have to update to a newer version. If you want to use another toolbar than the one you have configured for the main content editor, just give the name of the toolbar as second parameter, e.g.

<?php echo coco('small_content', 'sidebar');?>

The screenshot shows the co-contents in edit mode:

edit-mode

The width and height of the textarea resp. the editor default to 100% of its container. The height can be changed by a third parameter to the coco() call, e.g.

<?php echo coco('my_content', 'sidebar', '500px');?>

If you want to change the width, you can do so in the stylesheet.

The co-contents are stored in Coco_XH's data folder in an (X)HTML file with the name given as first parameter, e.g. my_content.htm. The structure is similar to that of CMSimple's content.htm file. The pages are separated by <h1>, <h2> or <h3> according to their menu level. (Therefore it's not possible to use these headings in the co-contents; they will be automatically converted to <h4>.) The names of the page headings are inserted for better readability only; they are ignored by Coco_XH. Instead the link to the page is made with the id given for the heading. You must not alter these ids in any way! Creating new pages by inserting new headings is not possible; these will simply be ignored.

Note that a backup of all co-contents is automatically made on logout. This is done the same way as CMSimple makes backups of the content. If you want to restore a backup, you have to do it via FTP.

Searching

If you want CMSimple_XH's search function to search your co-contents too, you have to replace cmsimple/search.php with plugins/coco/search.php. The search will work the same as in CMSimple_XH 1.5.x.

Administration

You can administrate the co-contents in Plugins→Coco→Co-Contents. Currently it's only possible to delete co-content files that you don't need any more. It's however important to delete those files as they will automatically being searched by the search function; besides taking time it might give wrong search results.

License

Coco_XH is licensed under GPLv3.

© 2012 Christoph M. Becker

Slovak translation © 2012 Dr. Martin Sereday
Czech translation © 2012 Josef NÄ›mec

Credits

Coco_XH was inspired by Ricardo Serpell's Also plugin.

The plugin icon is designed by Andy Gongea. Many thanks for publishing this icon as freeware.

This plugin uses free applications icons from Aha-Soft. Many thanks for making these icons freely available.

Many thanks to the community at the CMSimple forum for tips, suggestions and testing. Particularly my thanks go to snafu and Ulrich, who pointed out the usefulness of Also and changed my mind on where to store those data, and to Gert and snafu who reported the first bugs and suggested the new name.

And last but not least many thanks to Peter Harteg, the "father" of CMSimple, and all developers of CMSimple_XH without whom this amazing CMS wouldn't exist.