Hi everyone!
I was wondering how to get custom page template settings working.
In the index.js
a custom template is added:
(markdown code now works fine)
import { addPageTemplate } from "@factor/templates"
addPageTemplate({
name: "My Landing Page",
slug: "landing",
component: () => import("./templates/tpl-landingpage.vue")
})
Script part of templates/tpl-landingpage.vue
:
import { stored } from "@factor/api";
import Vue from "vue";
export default Vue.extend({
computed: {
post() {
return stored("post") || {};
},
settings() {
return this.post.settings || {};
}
},
templateSettings() {
return [
{
input: "text",
label: "Heading",
description: "Primary page heading",
_id: "pageHeading",
default: "Landing Page Template"
},
{
_id: "boxes",
input: "sortable",
label: "Feature Boxes",
description: "Some feature boxes",
default: [{ __title: "Box 1" }, { __title: "Box 2" }],
settings: [
{
input: "text",
label: "Heading",
_id: "heading",
default: "Box"
},
{
input: "image-upload",
label: "Icon",
_id: "icon"
}
]
}
];
}
});
If I now try to create a new page I can choose the template but no settings are visible:


Am I missing something?