a-ok Posted January 31, 2019 Share Posted January 31, 2019 Just a little thing but I tend try and use as many 'global' fields as possible across my sites (global_text, global_textarea, global_file, global_files etc.) and when you add each to a different template you can change the title of the field for that template, which is great, but what would also be great is for, say textareas, you could amend what's in the CKEditor Toolbar for the same field but on different templates. Sometimes templates just need Bold and Italic whereas some others need a lot more and having to allow the client access to the 'maximum' number when it's not required gets a bit frustrating. Anyway... just my thoughts! Link to comment Share on other sites More sharing options...
Zeka Posted January 31, 2019 Share Posted January 31, 2019 Hi @a-ok Take a look at this part of 3.0.87 blog post https://processwire.com/blog/posts/pw-3.0.87/#new-field-template-context-settings 2 Link to comment Share on other sites More sharing options...
tpr Posted January 31, 2019 Share Posted January 31, 2019 Or with AdminOnSteroids' FieldOverrides feature: https://github.com/rolandtoth/AdminOnSteroids/wiki/FieldOverrides 1 Link to comment Share on other sites More sharing options...
a-ok Posted January 31, 2019 Author Share Posted January 31, 2019 1 hour ago, Zeka said: Hi @a-ok Take a look at this part of 3.0.87 blog post https://processwire.com/blog/posts/pw-3.0.87/#new-field-template-context-settings This. Changes. Everything. EDIT: Ah this doesn't work with RepeaterMatrix fields (which has the same popup to edit a field as template) Link to comment Share on other sites More sharing options...
a-ok Posted January 31, 2019 Author Share Posted January 31, 2019 You can see the differences in the DB table `fieldgroups_fields` between the template changed field and the RepeaterMatrix changed field... The `fieldgroups_id` and `fields_id` are correct I wonder if it's just not built to work? Doesn't work with repeaters either. Link to comment Share on other sites More sharing options...
Robin S Posted January 31, 2019 Share Posted January 31, 2019 8 hours ago, a-ok said: Ah this doesn't work with RepeaterMatrix fields If you mean you want to have different toolbars for different matrix types that use the same CKEditor field then changing field settings in template context is not going to be a solution because all matrix types within a Repeater Matrix field use the same template. And some hook that checks the matrix type is not going to be a solution either because there is only a single CKEditor configuration per CKEditor field that is sent to the ProcessWire.config JS object. So all instances of a CKEditor field on a page get the same config. I think the only way to have different CKEditor configs for different matrix types is to use a different CKEditor field for each matrix type that needs a custom toolbar. If you want to use those CKEditor fields in different templates besides the Repeater Matrix template then you can use template context for overrides. 1 Link to comment Share on other sites More sharing options...
a-ok Posted January 31, 2019 Author Share Posted January 31, 2019 23 minutes ago, Robin S said: If you mean you want to have different toolbars for different matrix types that use the same CKEditor field then changing field settings in template context is not going to be a solution because all matrix types within a Repeater Matrix field use the same template. And some hook that checks the matrix type is not going to be a solution either because there is only a single CKEditor configuration per CKEditor field that is sent to the ProcessWire.config JS object. So all instances of a CKEditor field on a page get the same config. I think the only way to have different CKEditor configs for different matrix types is to use a different CKEditor field for each matrix type that needs a custom toolbar. If you want to use those CKEditor fields in different templates besides the Repeater Matrix template then you can use template context for overrides. This is all fair! Thanks for the explanation. FYI it doesn't work for Repeaters either... but maybe that's a different thing. Link to comment Share on other sites More sharing options...
a-ok Posted August 8, 2019 Author Share Posted August 8, 2019 Apologies to bring this back up but I'm curious to know why this doesn't work for standard repeaters? They use a separate template, for example 'repeater_about', so even if I change this by editing the template by showing the system templates it still doesn't work. Considering repeater rows are 'pages' and use their own template... you would think it would work? Link to comment Share on other sites More sharing options...
Robin S Posted August 8, 2019 Share Posted August 8, 2019 13 hours ago, a-ok said: Considering repeater rows are 'pages' and use their own template... you would think it would work? I think it's a bug and I've opened an issue here: https://github.com/processwire/processwire-issues/issues/956 Regarding different CKEditor configs per Repeater Matrix type, Ryan has suggested some code in a recent topic in the ProFields forum: 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now