Output Pico CMS page data as raw text, html, json or xml with ?output
.
Copy PicoOutput.php
to the plugins/
directory of your Pico Project.
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>: https://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*: https://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>: https://monsite.com</p>"} |
xml |
The page data in xml format. | <page><id>index</id><url>https://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>: https://monsite.com</p></content></page>"} |
Note that some formats output the page meta or basic internal data.