Browser
Pantheon Content Publisher SDK for Browsers
A simple and easy to use browser client for the Pantheon Content Publisher API
Requirements
- A published Pantheon Content Publisher article
- A Pantheon Content Publisher Token. Obtain one from the PCC CLI.
Usage
- Add the script tags that load the SDK to your HTML file:
<-- Add this to the <head> of your HTML file or right before the closing </body> tag -->
<script
src="https://unpkg.com/@pantheon-systems/pcc-browser-sdk@latest/dist/index.js"
data-site-id="<your PCC Site ID>"
data-token="<your PCC Token>"
></script>
- Add the
pcc-article
custom element to your HTML file. Place it where you want
the article to be rendered.
<pcc-article id="<id of your article>">
Loading...
</pcc-article>
That's it! You should now see yur article rendered in your browser.
Options
The pcc-article
custom element accepts the following attributes:
id | String | Yes | The ID of the article you want to render |
slug | String | Yes if id is not provided | The slug of the article you want to render |
disable-styles | Boolean | No | Disable rendering default styles for the article |