Extending the keystone.js core

Now we have the new theme almost ready.

We will now see how we can extend the core keystone.js and add another page on our blog, as the previous screenshot shows, we have an ABOUT menu item, so let's create it:

  1. Create a new file called About.js inside models/folder and add the following lines of code:
     var keystone = require('keystone'); var Types = keystone.Field.Types; /** * About Model * ========== */ var About = new keystone.List('About', { // Using map to show title instead ObjectID on Admin Interface map: { name: 'title' }, autokey: { path: 'slug', from: 'title', unique: true }, }); About.add({ title: { type: String, initial: true, default: '', required: true }, description: { type: Types.Textarea } }); About.register(); ...

Get Node.js 6.x Blueprints now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.