Within a channel form, is it possible to override/specify the editor configuration that wygwam uses?

For example:

{exp:channel:form channel="post"}
    <label>Post Content</label>
    {field:wygwam_field editor="basic"}

Basically, I want the users in the CP to have access to the "Full" editor. But users submitting content via the front-end/Channel Form to have a "basic" editor load.

Is this possible?


For developers:

Not easy, the display_field() method from wygwam gets its settings early on. However you maybe able to pluck apart the toolbars in the hook "wygwam_config".

See https://github.com/pixelandtonic/wygwam_super_admin_source for an extension that adds a "source" button for super-admins. You could use that as a basis to remove / set other config options as well (e.g. based on REQ == CP or ACTION or PAGE)

Edit: more info http://docs.pixelandtonic.com/wygwam/developers/wygwam_config.html
Edit2: even better http://dmlogic.com/blog/managing-wygwams-settings-via-code/

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.