Watermarkable

Cloud CMS lets you configure your content so that watermarks are automatically applied when content is created and updated. This lets you systematize the watermarking of your images to ensure consistency across your project. You can maintain a single watermark or multiple watermarks and divide up how they are applied on both a per-content instance and per-content type basis.

To start, you simply upload a watermark image to Cloud CMS. Typically, watermark images are image/jpeg or image/png. But you're free to use any image mimetype that you like. Cloud CMS will automatically convert images on the fly to match any desired output format needed.

You then tag content as watermarkable which indicates that a watermark should be applied to one or more of a content node's attachments upon write.

The f:watermarkable feature

Watermarking is delivered as a content feature. You can stamp any of your nodes with this feature at any time to introduce the watermarking behavior. Or you can stamp a content type with this feature to introduce the behavior across all nodes of the given type.

The feature is configured with a block of JSON which looks like this:

"f:watermarkable": {
    "<attachmentId>": {
        "watermarkNodeId": "<watermarkNodeId>",
        "watermarkNodeAttachmentId": "<watermarkNodeAttachmentId>"
    }
}
  • identifies the attachment that will receive the watermark
  • identifies the node that holds the watermark
  • (optional) identifies the attachment that holds the watermark (default is default)

For example, suppose you had a node with a single attachment (default) that has a picture of the Green Bay Packers team. You might want to watermark this with your company logo. You upload your company logo. Let's imagine your company logo has the GUID 12345. You would then add a feature to your Green Bay Packers team node:

{
    "_features": {
        "f:watermarkable": {
            "default": {
                "watermarkNodeId": "12345"
            }
        }
    }
}

The f:watermarkable feature is applied to the node. Now, when the Green Bay Packers team photo (stored in the default attachment, is updated, a watermark will instantly be applied. The watermark is held on the default attachment of the node identified by GUID 12345. If you wanted to, you could point to a different attachment for the watermark node using the watermarkNodeAttachmentId property.

The f:watermarkable feature lets you wire in cross-cutting concerns (like the watermarking behavior) to individual nodes one a time. You can also do entire content types at once as shown below.

Applying to a Content Type

As with any feature, you can either apply it at the node instance level or at the node type level. Applying it at the type level lets you cut across all instances of nodes with the given type.

Let's imagine we have a content type called sports:team. Our Green Bay Packers node is an instance of this content type. We might have something like this for our Green Bay Packers node:

{
    "title": "Green Bay Packers",
    "_type": "sports:team"
}

We can then add the f:watermarkable feature to the sports:team content type:

{
    "title": "Sports Team",
    "_type": "d:type",
    "qname": "sports:team",
    "mandatoryFeatures": {
        "f:watermarkable": {
            "default": {
                "watermarkNodeId": "12345"
            }
        }
    }
}

From now on, any node instances of type sports:team will pick up the mandatory f:watermarkable feature. All of their default attachments will be stamped with our watermark image when the attachments are either created or updated.

Watermarkable

Indicates that one or more binary attachments of a node should be watermarked upon write.

For more details on watermarking, including samples and configuration, please check out the watermarks chapter in the Cloud CMS documentation.

Configuration

<thead>
    <tr>
        <th>Property</th>
        <th>Type</th>
        <th>Default</th>
        <th nowrap>Read-Only</th>
        <th>Description</th>
    </tr>
</thead>
<tbody>
    <tr>
        <td>{attachmentId}</td>
        <td>object</td>
        <td></td>
        <td></td>
        <td>
            The ID of the attachment to work against.  In most cases, this will be <code>default</code> to indicate
            the default attachment.  The value should be a watermark configuration block that tells the
            watermarking engine how to generate and apply the watermark to the image.
        </td>
    </tr>
</tbody>

Watermark Example

For a complete watermark example, please check out the documentation page on Watermarks.