Business

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

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’
}
]
};

Related posts

Boeing Keeps Dow in Positive Territory as Stock Market Slides

admin2 admin2

Rare, million-dollar copies of a letter written by Christopher Columbus replaced with fakes – 60 Minutes

admin2 admin2

The US government faces a potential default in September, report says

admin2 admin2

Leave a Reply