You can automatically create content articles on instances based on their type definition, and have links to the articles auto-created on the instance Overview tab.

Articles are a great way to store and share information about your processes including information that is not always easy to share, such as PID diagrams, HMI screens, plant layouts, equipment locations, and more.

The CMS provides a content editor that is easy to use and is accessible for front-end editing. Articles can have tables of content, galleries of images, and they are easy to link to from other content in the platform.

The instance(s) you auto-create articles for must derive from a type and the type must have a display script on it. 

How to create a Display Script that generates a CMS article

  1. In Model Explorer, open the Types tab and navigate to the type you want to create the article for.
    1. You cannot edit a type in the ThinkIQ Base Library; if necessary, create a sub-type by clicking the plus button to Create New Type (Derived from: type you have selected.) Complete the dialog and Save. 
  2. On the type, open the Scripts tab and add a script using the plus button at top right of container.
    1. Give the script a name
    2. Description is optional
    3. Choose php as the Language
    4. Select Display Script as the Run Mode
    5. Select Blank Script for Template
    6. Click Create button
  3. On the scripts tab, open the IDE by clicking on the monitor icon for the new script.
  4. Insert the following code snippet:
    <?php
    // This script uses 'smart_equipment.utility_classes.cms_article_class' to retrieve a CMS article and display it
    //  if the article does not exist, it will create it with some default text 
    use TiqUtilities\Model\Script;
    require_once 'thinkiq_context.php';
    $context = new Context();
    Script::includeScript('smart_equipment.utility_classes.cms_article_class');
    $article = new Article_manager($context);
    echo($article->get_content());
  5. Save the script.
  6. In Model Explorer on the Instances tab, create a new instance of your new type.
    1. Be sure to select your type and not its parent.
  7. In the Overview tab of your new instance, at the right of the container, you will see the 'your type name' Overview link. Click the link to create the new article.
    1. Use the browser refresh button to refresh the page, then open the Editor using the gear icon at the top right of the page.

Editing the Article