Home Business ApostropheCMS | An open-source Node.js CMS for the Enterprise

ApostropheCMS | An open-source Node.js CMS for the Enterprise

by admin2 admin2
13 views
ApostropheCMS | An open-source Node.js CMS for the Enterprise

// my site configuration, app.js

var apos = require(‘apostrophe’)({
shortName: ‘mySite’,
title: ‘My Site’,

modules: {
‘apostrophe-templates’: {},

‘my-article’: {},
‘my-article-pages’: {},
‘my-article-widgets’: {},
‘my-article-cascade-widgets’: {},

‘my-person’: {},
‘my-person-pages’: {},
‘my-person-widgets’: {},
‘my-person-contact-widgets’: {},

‘my-custom-marquee-widgets’: {}
}
});

// template

{% extends ‘apostrophe-templates:layout.html’ %}

{% block title %}{{ data.page.title }}{% endblock %}

{% block main %}
{{ data.page.title }}

{{ apos.area(data.page, ‘content’, {
widgets: {
‘apostrophe-rich-text’ : {},
‘apostrophe-images’ : {
aspectRatio: [4, 3]
},
‘my-custom-marquee’ : {}
}
}) }}

{% endblock %}

// widget schema

module.exports = {
label: ‘My Custom Marquee’,
addFields: [
{
name: ‘theme’,
label: ‘Theme’,
type: ‘select’,
choices: [
{ label: ‘Light Gray’, value: ‘lightGray’ },
{ label: ‘Dark Blue’, value: ‘darkBlue’ }
]
},
{
name: ‘image’,
label: ‘Image’,
type: ‘singleton’,
contextual: true,
widgetType: ‘apostrophe-images’,
options: {
limit: 1,
aspectRatio: [4, 3]
}
},
{
name: ‘_article’,
label: ‘Article to Link’,
type: ‘joinByOne’,
withType: ‘my-article’
},
{
name: ‘caption’,
label: ‘Caption’,
type: ‘string’
}
]
};

You may also like

Leave a Comment