Message of the day:
Security release 4.4.4 is out. Changelog: https://github.com/silverstripe/silverstripe-framework/blob/4/docs/en/04_Changelogs/4.4.4.md
SilverStripe 4 related information and questions.
OK, Ima going to see how to do what you need. I'm curious now... P-P
Guys can you use a thread please?
Granted...that's both server side and client side changes required...
Using that syntax, you can take the
CheckboxsetField (which extends
FormField) and pass a custom path to the overridden template rather than relying on SilverStripe's built-in logic
Case in point:
If you absolutely need to. My point here is that if there's way to do it programmatically within an
Extension class for example, then that's more maintainable that overriding a default template that may break in subsequent versions of the CMS' UI
but overriding a template for use in the CMS should be straightforward?
but i dont think i can have 3 separate fields - since they are all saving to the same many-many relation
OK, I'll try to see how to do what you need. I'm curious now....
so i tried this:
- $field = CheckboxSetField::create();
does setting the template need to be a static method?
No, you can tell by the camel-case naming (Or just inspecting
still renders default template in the CMS context
i can see the template is the first one in
$field->ThemeDir() is set to
which does not have my custom template
since my template is in
this seems to have an effect:
i can now extend the regular field, and the cms will use my custom template
maybe its so that public facing form templates dont mess up the CMS
But just came to the conclusion that
http://CheckboxSetField.ss isn't actualy the template being used where I think it is
yeah - that does not mention anything about the theme separation
I recall having to programmatically add themes on an ad-hoc basis before like you've done.
thanks for helping me think it through! appreciated 🙂