tires Posted yesterday at 12:21 AM Posted yesterday at 12:21 AM How can I use a radio button with multiple options (as shown below in the image under “license”) in an image field? Is this also possible with a select field? Which fields can I use?
virtualgadjo Posted 23 hours ago Posted 23 hours ago Hi when it comes to a "select" just install the select options module which is in pw by default and then when adding a new field you'll be able to choose when it comes to images, having a close look at the full article from which the image you show comes https://processwire.com/blog/posts/pw-3.0.142/ you'll see that it relies on a template you create witjh a given naming convention --- quote--- Rather than trying to come up with some new way of defining custom fields, you define the custom fields for your file/image field with a Template. Simply create a template having the name "field-[name]" (replacing "[name]" with the name of your file/image field), add fields to it, save, and that's it. It's okay to add fields that might duplicate those already on your regular page template, as the fields for files/images are properties of each file/image rather than properties of any page. ------- not only will you be able to use radio button but nearly any kind of fields you would like to associate to the image hope it helps a little 🙂 have a nice day 2
tires Posted 17 hours ago Author Posted 17 hours ago @virtualgadjo Thank you very much for your reply. The “select” fields you mentioned do not appear in my image field when I add them as custom fields. Apparently, not all fields can be used. Quote You may use fields of these types: Text, Textarea (non CKEditor), Integer, Float, Page Reference, Checkbox, Toggle, Datetime, Email, URL. You may also use the multi-language versions of core Fieldtypes
virtualgadjo Posted 16 hours ago Posted 16 hours ago Hi again 🙂 actually, all those fields are not available in an image field by default but become so when you associate a specific template to the given image field say for example you have an image field named myfooimg if you create a template named field-myfooimg all the fields you use in this template will be availabe for you image datas, text, list of radio/checkboxes and so on... have a nice day
monollonom Posted 14 hours ago Posted 14 hours ago I just tried on a test setup to install the FieldtypeOptions module and add it as an image’s custom field but it is not displayed when editing an image, nor is it available to toggle on in the FieldtypeFile’s module settings: And it's actually normal behavior as this Fieldtype is basically blacklisted as a FieldtypeFile’s custom field. @tires your best bet is to use a Page field instead and have your options stored as pages somewhere: 1
virtualgadjo Posted 12 hours ago Posted 12 hours ago hi again 🙂 @monollonom is right the solution is to use pages, you can do this with the page reference fielfd and get this kind of thing quite easily sorry most things are in french its just in a demo website i use to help french guys with pw 🙂 you can see i hav a spécial field named resume and a list of radio button coming from a page reference field allowing hidden pages, the parent page is like this as you can read in the blog page, you can use any kind of type for those page reference fields, actually it works a lot like the way i use them for blog categories and/ot tags have a nice day 1
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