Skip to content

Objects

On the other hand, objects can have a variety of data-phosis-* attributes that help define how an individual object should behave and how it can be used. You can read about these in the Detailed Guide to Objects.

Not to be confused with…

These used to be called “blocks.” Because Phosis also has the the concept of “Content Blocks,” we found this terminology pretty confusing. We’ve now standardized on “object”.

Your previous object templates will continue to work without modification. Moving forward, however, Phosis templates will use this new attribute names in this documentation, and we suggest you do the same to avoid confusion!

data-phosis-object

This is the basic attribute that indicates an item of interest that will be hydrated by Phosis. When an object template is placed in a container in Phosis, all of its objects are located and you’re prompted to choose how they should be hydrated.

The name you choose for the object can have spaces in it and will be displayed when you’re configuring the template.

In the following example, the web developer created a placeholder title of “I Am A Title” that will be replaced with whatever is specified when configuring this object.

Example:

<h3 data-phosis-object="Title">I Am A Title</h3>

If you omit data-phosis-object-attributes (described below), Phosis will generally default to replacing the object’s text with whatever value/content when hydrating.

However, if the object is any of the following, it will default to:

Tag(s) Default attribute
img, iframe, audio, script, or similar src
input, select, or textarea value
a, link href

Remember, you can always specify the exact attributes you want to populate by using data-phosis-object-attributes.

PageTitle, PageDescription and Other Page-Level objects

Name your object PageTitle or PageDescription and its contents will be auto-populated correctly. A configurable option for title format will be coming soon.v1.0

There are other page-level object options documented in Page Attributes.