Unfortunately, the only way to achieve this is to create a custom Field Type in code that implements an existing field, for example. Single Line Text . There is no other configuration where you need to change, you need to add your attributes using the code, the ability to take and extend the "main" code is what Sitecore knows.
But itβs very simple to add these attributes and not redo every field if you just implement existing ones. Then simply select your individual text for a single line in the Type drop-down list and view the new attributes.
Implementing the existing Fields will give you everything that Single Line Text will be ready with its attributes, now you need to define the attributes in your new class . The public properties attributes of your class, decorated with visual properties.
For example, I wanted the attribute to hold the file size limit in the FileUpload field, which can be done by adding the public string property;
public class CustomSingleLineText : SingleLineText { private int _fileSizeLimit;
Then you can access the attribute value entered by the Content Editor in the view or even valiadator by getting it from Parameters FieldItem - FieldItem ["Parameters"]
For a complete source example, see this post;
http://jonathanrobbins.co.uk/2015/10/06/sitecore-marketplace-module-secure-file-upload/
source share