Default mappings
Ahoy, Beta Stuff Ahead!
This feature in Phosis is very much hot-off-the-presses and in testing. It was previously undocumented since its release in early 2021 because not all edge cases had been tested. However, we’ve decided it’s potentially too useful to continue hiding. Please let us know of any issues you may encounter!
Phosis allows you to specify default data mappings in your object configuration. This saves you time when configuring templates. Phosis will attempt to map the object’s values/attributes to the default fields you specify, depending on the selected datasource.
For example, you may know that an object you’re working with is always used for articles or pages. So, you’ll set up default bindings for the title, hero image, slug, body content, author, etc. You can always change this configuration when setting up the content block and mapping the data source.
You specify your default bindings as a part of the data-phosis-object-attributes
attribute:
<a data-phosis-object="TitleLink" data-phosis-object-attributes="text{title},href{slug}">I Am A Title</a>
You can also combine this with friendly attribute aliases:
<a data-phosis-object="TitleLink" data-phosis-object-attributes="text{title}[Title],href{slug}[Links To]">I Am A Title</a>
If a field you specify doesn’t exist on the selected datasource, the default behavior will be invoked and the mapping will be blank until chosen from the dropdown.
Available fields¶
Self, Pages, Articles/Shared Articles¶
- Base
- Title:
Title
- Summary/Lede:
Lede
- Description:
Description
- Body:
Data
(Self, Pages, or Articles only, not Shared Articles) - Hero Image URL:
HeroImage
- Date Posted:
DatePosted
- Slug:
Slug
- Title:
- Author
- Name:
Author.Name
- Email Address:
Author.EmailAddress
- Author Image URL:
Author.ProfileImage
- Short Bio:
Author.ShortBio
- Full Bio:
Author.FullBio
(Self, Pages, or Articles only, not Shared Articles)
- Name:
- Taxonomy
- Category Name:
Category.Name
- Category Slug:
Category.Slug
- Category Name:
Custom Data¶
If you know your custom data column names, you can use these as default bindings as well.