2

Is it possible to hide a custom field from the modal that appears when you double-click on a related entry inside a Entries field?

In other words, I don't want my custom field to be visible within the modal that comes from getEditorHtml.

===== Updated based on accepted answer below =====

Based on the accepted answer from @Tyler Willingham I used the following code in my plugin's main plugin file:

public function init()
{
    parent::init();
    if (craft()->request->isCpRequest()) {
        craft()->templates->includeJsResource('myPlugin/js/myJs.js');
    }
}
2

If you're looking for a setting you can apply to the plugin that corresponds to your custom field, it doesn't look like such a setting exists.

Update: I was just made aware of this Craft CP JS plugin in another question. It looks like you could potentially hide your plugin from displaying. It's not as elegant as a first-party solution but it may be worth a shot

|improve this answer|||||
  • Opinion: I could see it being useful to have a way to toggle which fields are available for quick edits (maybe only required fields?). – Tyler Willingham Jul 12 '14 at 3:23
  • I agree that this feature would be useful, but as in my case, I don't want it to be optional. I would love for a way for the plugin to the force this behavior anytime the Field Type is being used. – Peter Tell Jul 12 '14 at 3:29
  • Can you provide some context for when this doesn't make sense? Does the visual representation of your field not make sense within the confines of the modal? – Tyler Willingham Jul 12 '14 at 3:30
  • Pretty much. I have a plugin that opens up a modal for it's management and you'd start getting modals in modals, and it could cascade. – Peter Tell Jul 12 '14 at 3:39
  • Seems like a good use case for such a setting. I'm convinced :) – Tyler Willingham Jul 12 '14 at 3:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.