Skip to content

Instantly share code, notes, and snippets.

@pcorey pcorey/categories.js

Last active Aug 29, 2015
Embed
What would you like to do?
Editable Categories in Meteor's Orion
orion.dictionary.addDefinition('categories', 'basic', {
type: [String],
label: 'Categories'
});
orion.addEntity('articles', {
title: {
type: String,
label: 'Title'
},
category: {
type: String,
allowedValues: function() {
return orion.dictionary.collection.findOne()['categories'];
},
autoform: {
options: function() {
return orion.dictionary.collection.findOne()['categories'].map(function(value) {
return {
value: value,
label: value
};
});
}
},
optional: false,
label: 'Category'
},
content: orion.attribute('froala', {
label: 'Content',
optional: false
})
}, {
icon: 'bookmark',
sidebarName: 'Articles',
pluralName: 'Articles',
singularName: 'Article',
tableColumns: [
{
data: 'title',
title: 'Title'
},
orion.attributeColumn('froala', 'content', 'Preview')
]
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.