Skip to content

Custom Data

Custom Data is Phosis’s powerful approach to allowing you to reuse content throughout your site without having multiple copies of that information floating around.

You can create data sources as tables with a structure that you define & populate. These tables of data can then be used to hydrate content blocks via containers/templates.

They give you a centralized single location to manage information that can appear on multiple pages.

Custom Data UI

Editing custom data
Editing custom data

When creating custom data, you can click to add as many columns and their types (described below) as you want. When you’re editing custom data, the columns are hidden by default — click the disclosure triangle to view them & add more.

You can also choose to make your custom data available to all sites within your account/system.

Caution

You cannot remove columns after you save your custom data as of v0.76. So, be mindful of your data structure when you’re setting up your table!

Column Types

When you’re creating or editing Custom Data, you define how many columns you want each row of data to have, and what the data type of those columns should be. Choosing the data type lets Phosis show you customized editors when you’re adding/editing rows, and also gives Phosis the context it needs when it’s hydrating your templates using Custom Data.

Id

An auto-generated, auto-populated, and permanent numeric column with a unique entry for every row in your custom data table, useful for sorting. Each row in your custom data table has an Id assigned when you save your data, and that Id doesn’t change.

Text

A plain text column of any length. When editing a row, the text box will automatically expand as you type to hold all of your content.

If you include any line breaks, these will be converted in to <br> when rendering.

Markdown Text

A text column of any length that will render Markdown syntax for formatting. When editing a row, the text box will automatically expand as you type to hold all of your content.

You can read more about formatting with Markdown in this excellent guide from Markdown Guide.

An important note on Phosis’s Markdown parser:

If your content has more than one line of text separated by two carriage returns, it automatically invokes paragraph mode, wrapping each paragraph in <p></p>. If your content doesn’t — if it’s a single line, in other words — the rendered output is not wrapped in paragraphs. This is to allow you to populate elements directly or render out body text.

Number

A column that holds numeric data, either an integer (whole) number or a number with any number of decimal points.

Datetime

A column that will store exact date & time values, with a date/time picker.

Date

A column that will store exact date values, with a date picker.

Time

A column that will store exact time values, with a time picker.

File

A column that maps to files/media within Phosis. When editing a row, you will be prompted to select a file within Phosis’s Files & Media browser (by double clicking). Phosis will automatically maintain the link to your selected file, even if the underlying file gets moved into another folder.

Note

The File column type will return the permalink to your selected file when hydrating.

Let’s look at an example: A common request on small business websites are customer testimonials.

Let’s say you want to have one page on your site that contains all testimonials, but you also want to have a random testimonial appear on some other pages.

Using Custom Data, you might define a new data table with the columns of Name (of type Text), Location (Text), Testimonial (Text), and Customer Image (File). Then, once you’ve created your data table, you can go through and populate your rows with the information that maps to each column.

Data Mapping

On the content block & template side, you (or your frontend developer) can then choose your data table as the data source and map its columns to your template’s options, choose the quantity to display, and the sort order/method. More on this in the Data source mapping and options & filters section of Using Templates.

Another option would be a photo gallery: set up custom data table for the Image (File) and perhaps Description (Text) columns, then use those to populate a photo gallery template you’ve created.

Settings Mode

Enabling this checkbox and saving converts your custom data table to a settings object inside of Phosis. Settings objects have a slightly modified editor and can be used when entering template contents directly while editing content blocks.

Mapping object template fields to entries in a settings object lets you edit the content via this custom data and see your changes reflected immediately in every location on your site where the settings object is used.

If you convert an existing custom data to a settings object, only the first row is relevant. You can convert back and forth between standard custom data and settings objects without data loss.

You can have as many settings objects in Phosis as you wish. For example, you may choose to set one up that contains some reusable copy for your site, another that contains your images, etc.