nliautaud / pico-output

A plugin to output the page content or data as raw, html, json or xml in Pico CMS.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pico Output

Output Pico CMS page data as raw text, html, json or xml with ?output.

Installation

Copy PicoOutput.php to the plugins/ directory of your Pico Project.

Usage

Configure the plugin and enable outputs formats in the Pico config file (for site-wide settings) or in the page metadata.

PicoOutput:
    formats: [content, raw, prepared, json, xml]

Then add ?output=format to a page url.

format desc. example
content The html content. <p>Some content. <emph>base_url</emph>: http://monsite.com</p>
raw The raw page, with meta header and raw variables. ---\nTitle:My title\n---\nSome content. *base_url*: %base_url%
prepared The page content without the meta header and with parsed variables. Some content. *base_url*: http://monsite.com
json The page data in json format. {"id":"index","url":"http:\/\/monsite.com\/index","title":"My title","author":"","time":"","date":"","date_formatted":"","raw_content":"---\nTitle:My title\n---\nSome content. *base_url*: %base_url%","content":"<p>Some content. <emph>base_url</emph>: http://monsite.com</p>"}
xml The page data in xml format. <page><id>index</id><url>http://monsite.com/index</url><title>My title</title><author/><time/><date/><date_formatted/><raw_content>---\nTitle:My title\n---\nSome content. *base_url*: %base_url%</raw_content><content><p>Some content. <emph>base_url</emph>: http://monsite.com</p></content></page>"}

Note that some formats output the page meta or basic internal data.

About

A plugin to output the page content or data as raw, html, json or xml in Pico CMS.

License:MIT License


Languages

Language:PHP 100.0%