Message of the day:
Release 4.5.0 is out. Changelog: https://docs.silverstripe.org/en/4/changelogs/4.5.0
SilverStripe 4 related information and questions.
^^^ I don’t know if you can use that module in the frontend, I usualy use that for cms form fields, and I’d write the js part myselfe.
heh, just found this - https://github.com/unclecheese/silverstripe-display-logic - i think this is what I need
Hi All, I was trying to extend Silverstripe/Userforms, but instead decided to recreate my form using regular Silverstripe/Form code.
I have some fields that only need to display if the user selects something specific in another field, i.e. they pick 'option A' in a dropdown, and it makes 5 checkbox fields display, or a textbox display, etc.
What is the best way to accomplish with silverstripe? Is this just a matter of creating all of the form fields with php, and then using js to manipulate on the front?
Or is there some way to add conditional logic via php to the forms?
I want to add a
<img> tag just before the
Title inside a
DropdownField. Is it possible to do that?
Last time I did something similar I ended up creating my own version of
DropdownField and changeing the template
Rather, creating a custom template for the new field type
very nice idea thanks
Did you create a module of this? 😉
Something like this for the class?
And something like this in the template?
(I literally just made that up, so it may need some modification)
Nice thanks I will try to make it work
Obviously when you create the field you will have to set the image to the field
humm you mean
If you want the image to appear before the label, it has to be in the holder
the label is rendered in the field holder template
humm I'm getting the error
[Warning] filemtime(): stat failedIt miss the
Hmm, that is annoying, it should fall back to using
You could just clone http://DropdownField.ss into your project?
no error but nothing.. i think to JS is not loaded for my new DropdownField
oh i'm near to resolve the problem
Undefined property: DropdownWithImageField::$Image
Is Image reference is a path or a dataobject?
Yea, I am now just struggling to get a load of json into a data attribute
so it'll need to be somewhere that JS can see
yeah, only entwine will be aware of navigation within the CMS
to be honest, that makes more sense anyway
I am just re-writing it to try and use a data attribute instead
but the chart data depends on the record loaded