Is there a CustomEditTemplate?

Within the example Custom View Tags’ (& Extensions’) *.zip files I can see how to use node.js script to compile “CustomViewTemplate” properties that will replace fields on View Pages that have the associated “Custom View Tag” Field set.

So a custom View Tags’ js-within-zip looks like this:

— mycustomviewtag.zip → mycustomviewtag.js

global.mycustomviewtag= {
Name: “mycustomviewtag”,
CustomViewTemplate: function(o, tbl, fld, ctrl){
return <input type="text" readonly="" class="form-control-plaintext" value="<?php echo my_global_php_function(CurrentTable()->${fld.FldParm}->CurrentValue); ?>">;
}
}


But I could not find any examples of using the same pattern for Custom EDIT Tags.

What I have tried:

  1. Tag inside mycustomedittag.xml

I could see the use of the tag inside of the colorpicker.xml, but this doesn’t seem to allow me to access the field name/value in my PHP function (ie. I can’t see how to do the equivalent of “CurrentTable()->${fld.FldParm}->CurrentValue” in my custom edit tag’s PHP).
Of course, it does allow me to access {{{value}}} in my client-side code. However I need the field name & current value server-side, in the custom edit tag’s PHP.

  1. CustomViewTemplate" & “CustomEditTemplate” in mycustomedittag.zip → mycustomedittag.js

I tried a “CustomViewTemplate” and a “CustomEditTemplate” (guessing!) property inside a js-within-zip for a Custom EDIT Tag. But it just seems to get ignored. “CustomViewTemplate” works fine for my testing with Custom VIEW Tags using the js-within-zip pattern.

  1. Read the Help file!

I read the help file extensively but all of the examples are worded similar to “<?php if (CurrentPage()->MyField->CurrentValue == "xxx")....?>”. That is, it is assumed that we know the value of “MyField”. But the only way I can find to get MyField so far in a Custom View/Edit Tag is using the “${fld.FldParm}” in the js-within-zip pattern as above.

  1. Cleared the Template Cache, Rezipped, etc

Throughout all of this testing I was fanatical about clearing the template cache, replacing the xml & zip files after any updates, etc. So I’m sure it’s not a “did you test on the old file” thing.


So, my questions are:

A) Is it possible to use the js-within-zip pattern for Custom Edit Tags?
B) Is it possible to access the field’s name & current value within Custom Edit Tags (using js-within-zip, xml , or another method)?

Any help very much appreciated!

From the help file (see the topic Customizing Template), Custom Edit Template is same as Custom View Tag, you may use them in the similar way, replace “CustomViewTemplate” by “CustomEditTemplate”. You can get the field object by: (copied from a Custom View Template)

CustomViewTemplate: function(o, tbl, fld, ctrl) {
let table = tbl || TABLE, field = fld || FIELD, control = ctrl || CONTROL,
tblVar = table.TblVar;
return “your code”;
},

You may also use Custom Edit Tag, see the topic Field Setup → Edit Tags → Custom Edit Tag in the help file.