How do I create a datatype for the administration, where the user can type a password whithout showing the characters?
As if I created a passwordtype on a website etc:
Very bare bones example but Umbraco is great for extending so this should get you on your way:
First, create a package.manifest file, in this example it sits at: ~/App_Plugins/Sandbox/package.manifest. The Sandbox directory is a newly created on just for the plugin. The file looks something like this:
Then, we need to create an Angular controller which isn't strictly necessary but will give you something to hook into should you need to add functionality. This sits in our newly created plugin directory: ~/App_Plugins/Sandbox/assets/js/Password.Controller.js. That goes something like this:
angular.module('umbraco').controller('UmbracoSandbox.PasswordController', passwordController);
function passwordController($scope) {
console.log($scope.model);
}
Finally, we create the view which displays the field in the admin area. This sits at ~/App_Plugins/Sandbox/views/Password.html and looks like this:
Once this is done, you'll need to go into Developer -> Data Types and create a new Password data type for it to be available in your doc types.
As simple as that.
Just to note that there's no structure that Umbraco expects here part from the package.manifest file being in the root of your new plugin directory. Assets, views etc can live anywhere you like as long as you point your manifest file to the right place.
Create datatype for password
Hi
How do I create a datatype for the administration, where the user can type a password whithout showing the characters?
As if I created a passwordtype on a website etc:
Thank in advance
Daniela Edemann
Daniela,
Tim has written excellent article with source code on his blog about creating your own datatypes.
Regards
Ismail
I need to do that same thing that Daniela has described and would LOVE to see this added to a future version of Umbraco.
Very bare bones example but Umbraco is great for extending so this should get you on your way:
First, create a
package.manifest
file, in this example it sits at:~/App_Plugins/Sandbox/package.manifest
. TheSandbox
directory is a newly created on just for the plugin. The file looks something like this:Then, we need to create an Angular controller which isn't strictly necessary but will give you something to hook into should you need to add functionality. This sits in our newly created plugin directory:
~/App_Plugins/Sandbox/assets/js/Password.Controller.js
. That goes something like this:Finally, we create the view which displays the field in the admin area. This sits at
~/App_Plugins/Sandbox/views/Password.html
and looks like this:Once this is done, you'll need to go into
Developer -> Data Types
and create a newPassword
data type for it to be available in your doc types.As simple as that.
Just to note that there's no structure that Umbraco expects here part from the
package.manifest
file being in the root of your new plugin directory. Assets, views etc can live anywhere you like as long as you point your manifest file to the right place.Hope that helps :)
is working on a reply...