Mike-it Posted January 14, 2021 Share Posted January 14, 2021 I'm going crazy with this. Looking at the post https://processwire.com/blog/posts/pw-3.0.142/ The picture "says" that options are supported as a field, (see License block) but it does not work for me in any version i tryed in version: 1.48, 1.65, 1.70 If the field is not supported i would not show an image of that type. Am i wrong? 1 Link to comment Share on other sites More sharing options...
3fingers Posted January 14, 2021 Share Posted January 14, 2021 From the blog post you've linked: 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. For Page Reference fields, you may also use any of the core input types it supports. Radio input (like the "License" one shown in the image) looks like is not mentioned there, so yes, to me it looks like a misleading example. I read somewhere in the forum that ryan has the intention to make some polish on custom image field, but honestly I don't remember where. 1 Link to comment Share on other sites More sharing options...
Mike-it Posted January 14, 2021 Author Share Posted January 14, 2021 Thanks @3fingers I have read the blog post, but i also thought it was a text omission (the option field), because of the example image, which i doubt is a photomontage ? Link to comment Share on other sites More sharing options...
3fingers Posted January 14, 2021 Share Posted January 14, 2021 2 minutes ago, Mike-it said: Thanks @3fingers I have read the blog post, but i also thought it was a text omission (the option field), because of the example image, which i doubt is a photomontage ? Here is more information on the topic: Link to comment Share on other sites More sharing options...
adrian Posted January 14, 2021 Share Posted January 14, 2021 As @Robin S noted in the post that @3fingers linked to - that example is a Page reference field. I just recreated that here and it works as expected: A little OT, but creating Page Reference fields is really quick and easy with: https://processwire.com/modules/process-page-field-select-creator/ 4 Link to comment Share on other sites More sharing options...
Mike-it Posted January 21, 2021 Author Share Posted January 21, 2021 Thanks @adrian i'll give a look, i ended up using this mentioned module https://github.com/Toutouwai/RepeaterImages 1 Link to comment Share on other sites More sharing options...
Mike-it Posted January 28, 2021 Author Share Posted January 28, 2021 @adrian Thanks, i successfully recreated your example, using Page Reference and it works perfect in a multilanguage site (also used the module you mentioned https://processwire.com/modules/process-page-field-select-creator/) But suppose to have a multiple selection for "License type" so any image should dsplay all available license assigned This works with a single selection echo $image->option_type->title; Don't understand why it doesn't work with a foreach am i missing something? foreach($images as $image){ foreach($image->option_type as $opt){ echo $opt->title; } } Any help is appreciated ? Link to comment Share on other sites More sharing options...
adrian Posted January 28, 2021 Share Posted January 28, 2021 1 hour ago, Mike-it said: Don't understand why it doesn't work with a foreach am i missing something? Not sure @Mike-it - it's working here like this: What exactly are you seeing when you say it doesn't work? Link to comment Share on other sites More sharing options...
Mike-it Posted January 28, 2021 Author Share Posted January 28, 2021 I got this notice: *Notice*: Trying to get property 'title' of non-object... Link to comment Share on other sites More sharing options...
adrian Posted January 28, 2021 Share Posted January 28, 2021 Just now, Mike-it said: I got this notice: *Notice*: Trying to get property 'title' of non-object... Sounds like you need to double check the name of the "option_type" field and check that it is set to support multiple values. Debugging this stuff is much easier with the Tracy Console because you can dump at each step of the process to figure out where the problem actually is. 1 Link to comment Share on other sites More sharing options...
Mike-it Posted January 28, 2021 Author Share Posted January 28, 2021 Sorry solved... I'm little embarrassed, we have set the field option_type as single page ? not as a Multiple Pages PageArray now it works... 1 Link to comment Share on other sites More sharing options...
Mike-it Posted January 28, 2021 Author Share Posted January 28, 2021 Tracy Console intalled too ? 1 Link to comment Share on other sites More sharing options...
dotnetic Posted April 26, 2021 Share Posted April 26, 2021 @Mike-it could you add an issue to github, if it does not exist yet? 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