# Adding Custom Pages For each entity, ng-admin creates the necessary pages for Creating, Retrieving, Updating, and Deleting (CRUD) this entity. When you need to achieve more specific actions on an entity, you have to add a custom page - for instance a page asking for an email address to send a message to. How can you route to a specific page and display it in the ng-admin layout? ## Adding a Route ng-admin uses [AngularUI Router](https://github.com/angular-ui/ui-router) to define routes, parameters, and templates for pages. In UI router terminology, a page is a "state". ```js myApp.config(function ($stateProvider) { $stateProvider.state('send-post', { parent: 'ng-admin', url: '/sendPost/:id', params: { id: null }, controller: sendPostController, controllerAs: 'controller', template: sendPostControllerTemplate }); }); ``` Here the `controllerAs` property defines the name of the controller in the template. Also worth noting: `parent: 'ng-admin'` means that the "send-post" page will be displayed inside the main ng-admin layout. ## Page Controller and Template Define the controller and template in the usual Angular way (here, with the "controllerAs" syntax): ```js function sendPostController($stateParams, notification) { this.postId = $stateParams.id; // notification is the service used to display notifications on the top of the screen this.notification = notification; }; sendPostController.inject = ['$stateParams', 'notification']; sendPostController.prototype.sendEmail = function() { this.notification.log('Email successfully sent to ' + this.email); }; var sendPostControllerTemplate = '