> For the complete documentation index, see [llms.txt](https://docs.navigaglobal.com/everyware/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.navigaglobal.com/everyware/starter-kit-packages/everyware-plugin-presentation-preview/usage.md).

# Usage

This plugin is meant to be activated on a network level. Log in to "Network Admin -> plugins" to activate the plugin for all sites. The plugin will then expose its [API endpoint](/everyware/starter-kit-packages/everyware-plugin-presentation-preview/api.md) for previews.

{% hint style="info" %}
The "API endpoint" is compatible with the [Presentation Preview plugin](https://docs.navigaglobal.com/presentation-preview/) in Dashboard
{% endhint %}

## Adding support for article preview to your theme.

The plugin will load the file `previews/single-article.php` in the currently active theme. The plugin will also look for this file in a parent theme if WordPress theme inheritance is used.

From this file, the variable `$previewData` will be available. Here you will be able to find the data sent to the endpoint. The variable will implement `\Everyware\Plugin\PresentationPreview\Contracts\PreviewData`.

ex.

```php
use \Everyware\Plugin\PresentationPreview\Contracts\PreviewData;

if (isset($previewData) && $previewData instanceof PreviewData) {

    // This is where the article page should be rendered.
}
```

The basic `data` you will need is the article body from the `content`. This should be the NewsML body of the article. You will find it as `BodyRaw` in a public Open Content.

```php
use \Everyware\Plugin\PresentationPreview\Contracts\PreviewData;

if (isset($previewData) && $previewData instanceof PreviewData) {

    echo 'Content:' . $previewData->getContent();
}
```

You may also fetch any related material such as `Concepts` and `Articles`.

```php
use \Everyware\Plugin\PresentationPreview\Contracts\PreviewData;

if (isset($previewData) && $previewData instanceof PreviewData) {

    $articleUuids = $previewData->getRelatedArticles();
    $conceptUuids = $previewData->getRelatedConcepts();  
}
```

The *Imengine URI* can also be fetched through this interface.

```php
use \Everyware\Plugin\PresentationPreview\Contracts\PreviewData;

if (isset($previewData) && $previewData instanceof PreviewData) {

    $uri = $previewData->getImengineUri();
}
```

You can use the `getMetaData` method to get hold of any other `data` that might be sent to the API. This method will return an `array` of all the meta.

```php
use \Everyware\Plugin\PresentationPreview\Contracts\PreviewData;

if (isset($previewData) && $previewData instanceof PreviewData) {

    $meta = $previewData->getMetaData();
    
}
```
