Closed vladkucherov closed 9 years ago
Hi,
I guess the ace field type by Per Søderlind is what you are looking for. It is included in the demo component (Dashboard -> Demo -> Custom Field Types -> ACE ).
You may want to check it out.
Hi,
Is there a chance to include it in the field types plugin / the main plugin?
Not likely to be built-in.
To register a custom field type, you just instantiate the class that defines the custom field type. It should be straight forward.
Let me know if you have any difficulty doing that.
No difficulties, but it could be much easier if I didn't have to declare this:
new AceCustomFieldType( __CLASS__ );
in every metabox I create. also I think we should have a method to set global options (like all the field by default should be HTML and not CSS)
but it could be much easier if I didn't have to declare this:
As of v3.5, it is no longer required. Try not passing anything. It is still recommended to set a class though because if a class name is not set, the field type will be site-wide which can cause unexpected behavior for other plugins that use the framework.
It doesn't work without declaring a class. the deceleration only works on demo mode (the file is not included)
is there away to initiate the class without including the file on demo off?
It doesn't work without declaring a class.
Have you tried this?
new AceCustomFieldType;
And comment out the other lines that pass the class name. This way, the field type will be registered site-wide not per a class basis.
Yes I figured this out already. The problem is including the file... like with the rest of the files, I don't want to "know" the path to the file. especially if it's located inside "example"
maybe you should move the field type into the loader?
Just copy the class that defines the field type into your plugin/theme and include it from your convenient location. I don't see why this is hard.
I am not saying it's hard, but I think everything related to the framework should be loaded by the framework. I am just trying to come up with a better solution :-) that's all
Maybe do you want an admin page that lists activated field types and lets you activate/deactivate/upload field types?
Like an add-on to the minifier?
Like the plugins.php page of WordPress except that plugins are field types.
This is of course a great idea :+1:
Can you post a new topic about it? I'm going to close this one as it seem to be resolved.
Hi,
I would like to request a "code" field type that will have a textarea similar to JSFiddle.
Is it possible any time soon?
Thanks, Vlad.