Views: 2726
Number of votes: 12
Average rating:

Introducing a new SPA template site: MusicFestival

To demonstrate some concepts that are useful when creating a SPA with working OPE, we have released a new SPA template site on Github, called MusicFestival, together with a series of blog posts that will be available in the coming days (a complete list is at the bottom).

You might have seen the site at recent Episerver Ascend events. It was built as a showcase demo for the new Episerver Content Delivery API, and has since then been modified to a smaller Single-Page Application (SPA) site that is intended to show how to work with On-Page Editing (OPE). It also uses the Content Delivery API with some customizations for friendly URLs and flatter JSON results. The site also uses CMS UI 11.11.0 which introduces some improvements and bugfixes for SPA scenarios.

The default installation contains some example bands generated by a random band name generator, so it’s possible to demo straight away.

We will dig deeper in other blog posts, but you can already enjoy it on Github

We are not expert Vue.js developers, so there are probably improvements you can contribute.

Important: The template uses Vue.js but the concepts shown would be the same in React, Angular, or other client-side framework.


Blog series

Other blog posts

Oct 30, 2018

(By valdis, 10/31/2018 9:12:54 AM)

yup! :)

Thomas Higginbotham
(By Thomas Higginbotham, 10/31/2018 6:49:34 PM)

I see the MusicFestival site is using version 1.0.1 of the Content Delivery API. Are there any plans to update it to the 2.1.0 release?

I'm having some problems getting the new version to work, and I'm struggling to find any documentation on it.

Quan Tran
(By Quan Tran, 11/1/2018 5:28:52 AM)

Hi Thomas, we're upgrading MusicFestival to use ContentDeliveryApi version 2.1.0 and it will be available soon.

ContentDeliveryApi documentation is here ContentDeliveryApi dev guide

The ContentDeliveryApi SDK documentation is found here: ContentDeliveryApi SDK 

(By larswp, 11/5/2018 1:26:19 PM)

this looks very cool.

will you be showing how to use visitor groups with a SPA ?

John-Philip Johansson
(By John-Philip Johansson, 11/13/2018 12:05:31 PM)

@larswp the templates have a visitor group called "Last day", and the ContentDeliveryAPI team is working on visitor groups support (and other things that makes SPA's easier to work with in OPE).

John-Philip Johansson
(By John-Philip Johansson, 11/13/2018 12:16:29 PM)

@Thomas Higginbotham: We have now updated the template site to ContentDeliveryAPI 2.x. All related changes are in one commit so you can see what changes between 1.x and 2x:

(By larswp, 11/17/2018 8:54:05 PM)

Cool, i just tried the visitor group and that works 

I have another question then:

on a normal page or block i have a controller action. in that action i create a viewmodel, i add the model, and some calculated values to the viewmodel and give that to the view. The calculated values could be anything like the Current users Name or account information.

how would i do that with the ContentDeliveryAPI? can i call a controller and have the ContentDeliveryAPI return a viewmodel?

John-Philip Johansson
(By John-Philip Johansson, 11/26/2018 9:09:24 AM)

@larswp Interesting to hear that. Visitor group support hasn't been released yet :)

The ContentDeliveryAPI will serialize models by default. It can be extended through model mappers that you can read more about in the here:

There is an example in the MusicFestival site that might help. We add language and parentUrl properties to each returned API result, and flatten the JSON so values aren't under a "Value" property:

(By SReddim, 9/13/2019 10:06:23 AM)

Hi, Can we use this with Vue and Nuxt Js? Can you provide any insight how we can do that with a sample routing configuration.

Please login to comment.