Custom Post Types for Events in Square Space

October 11, 2018

To create a custom post type on an event in square space first add a name.conf, name.item and name.list to your collections folder in your custom template.

In your event name.conf file add in your title, ordering and add text title then set accept types to a custom type we will create after this. This can be any name you would like. We will use eventCustom for this example.


{
    "title" : "Custom Event",
    "ordering" : "chronological",
    "addText" : "Add Event",
    "acceptTypes": ["event", "eventCustom"]
}

Next, in your template.conf file under “customTypes” add new type with a title, name, base of event and then whatever fields you would like.


"customTypes" : [
    {
        "title": "Event Custom",
        "name" : "eventCustom",
        "base" : "event",
        "fields" : [{
            "name" : "hoverImage",
            "title" : "Hover Image",
            "type" : "image"
        }]
    }
]

Commit and push your updates to your square space site over git. When you go to add an event under your custom event collection you will now see an option for Event Custom.

To access your content from the template you may need to view the .json to get the correct path. I found it easiest to do this from the name.list page. The path should be similar to the following: { customContent.hoverImage.assetUrl }

Helpful resource: https://developers.squarespace.com/custom-post-types/

Stay in Touch!

Subscribe to our newsletter.

Solutions Architecture

browse through our blog articles

Blog Archive