Skip to content

Instantly share code, notes, and snippets.

@pnmcosta
Created August 6, 2018 13:39
Show Gist options
  • Save pnmcosta/bde08b2a9c905001c41c721db2a33424 to your computer and use it in GitHub Desktop.
Save pnmcosta/bde08b2a9c905001c41c721db2a33424 to your computer and use it in GitHub Desktop.
Total.js CMS admin component
// Add this file to /components/ directory
<script total>
// groups this component with admin
exports.group = 'admin';
exports.install = function() {
// include custom routes here
};
</script>
<div data-bind="common.page__show:value == 'work'" class="hidden">
work list is here!
</div>
<div data-jc="form__common.form__icon:briefcase;if:work-form;title:@(Edit);width:1500;autofocus:true" class="hidden">
work form is here!
</div>
<script>
var navItem = { role: 'Work', title: 'Work', url: '/admin/work/', value: 'work', icon: 'briefcase' };
ROUTE(navItem.url, function() {
EMIT('page', navItem);
SET('common.page', navItem.value);
});
ON('ready', function() {
common.nav.push(navItem);
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment