Robin S Posted July 2, 2020 Author Share Posted July 2, 2020 2 minutes ago, sz-ligatur said: I guess there is a typo in CustomInputfieldDependencies.module @Line 52 Thanks, fixed in v0.2.1. Link to comment Share on other sites More sharing options...
digitex Posted July 2, 2020 Share Posted July 2, 2020 @Robin S I just installed the latest version and upgraded from 1.9 to 2.1 (this morning). BRILLIANT!!!! Beautifully done. It works perfectly. Thanks again for a very handy module. 1 Link to comment Share on other sites More sharing options...
regesh Posted July 14, 2020 Share Posted July 14, 2020 Thanks for this module! It saved many hours for me. And one more thing i noticed. It has some bugs with toggle field value as dependency and when is used for field_tab But all other are works grate!)) Thanks again! Link to comment Share on other sites More sharing options...
Robin S Posted July 14, 2020 Author Share Posted July 14, 2020 2 hours ago, regesh said: It has some bugs with toggle field value as dependency and when is used for field_tab @regesh, that's a pretty vague statement. A proper bug report needs to include an exact description of the bugs and steps to reproduce them. Otherwise it's difficult to respond. As far as I can see the module works with FieldtypeToggle just fine. If you want to match a Toggle field in a selector you have to use the integer value - that isn't specific to this module, it's the way the PW core works. And by "field_tab" do you mean the core "Fieldset in Tab (Open)" aka FieldtypeFieldsetTabOpen? The module also works fine with this fieldtype so I don't understand the problem. If instead you are talking about the tab option of the non-core FieldsetGroup module that is part of ProFields then I've added support for that in v0.2.2. Link to comment Share on other sites More sharing options...
regesh Posted July 15, 2020 Share Posted July 15, 2020 Thanks' for reply. I'll check with "toggle" later. Link to comment Share on other sites More sharing options...
gornycreative Posted March 7 Share Posted March 7 Would I be able to use this to check if a repeater matrix item has any items assigned? I want to set up a drop down that only appears when a repeater is populated. Link to comment Share on other sites More sharing options...
Robin S Posted March 7 Author Share Posted March 7 6 hours ago, gornycreative said: Would I be able to use this to check if a repeater matrix item has any items assigned? I want to set up a drop down that only appears when a repeater is populated. Did you try something already and it didn't work? You should be able to use either the "Show only if page is matched by selector"... your_matrix_field.count>0 ...or the "Show only if custom PHP returns true" setting... $items = $page->getFormatted('your_matrix_field'); if($items && $items->count) return true; If you were wanting to do the opposite, i.e. show the field only when the matrix field is empty, then it should work to put "your_matrix_field.count=0" into the "Show only if page is matched by selector" setting but unfortunately there seems to be a core PW bug: https://github.com/processwire/processwire-issues/issues/1701 So until that's fixed you'd need to use the "Show only if custom PHP returns true" setting instead: $items = $page->getFormatted('your_matrix_field'); if($items && !$items->count) return true; Link to comment Share on other sites More sharing options...
gornycreative Posted March 8 Share Posted March 8 I tried using the simple matrix_field.count>0 rule, but it didn't work. I didn't realize I needed to include the inputfieldset name also. e.g. matrix_wrapper_fieldset.matrix_field.count>0 EDIT: Nope that didn't fix it. It just stopped showing anything. For some reason it is not recognizing the count of the matrix items. Is the data-show-if attribute in the HTML supposed to be escaped? e.g. data-show-if='meta_zone_1.count>0' data-required-if='meta_zone_1.count>0' Link to comment Share on other sites More sharing options...
Robin S Posted March 8 Author Share Posted March 8 4 hours ago, gornycreative said: I tried using the simple matrix_field.count>0 rule, but it didn't work. I didn't realize I needed to include the inputfieldset name also. e.g. matrix_wrapper_fieldset.matrix_field.count>0 I don't know what the field structure is in your template. It should work fine as described in my previous post. Inputfield names doesn't have much to do with it - you use field names just as you would in any selector. If the selector matches your page in $pages->find($selector) then it should work in the "Show only if page is matched by selector" setting. Seeing screenshots of your template fields and the settings you have chosen for CustomInputfieldDependencies would help. 5 hours ago, gornycreative said: Is the data-show-if attribute in the HTML supposed to be escaped? e.g. data-show-if='meta_zone_1.count>0' data-required-if='meta_zone_1.count>0' That isn't related to this module. It comes from the core show-if and required-if features, so if you are seeing that in your markup it means you are not using the features added by CustomInputfieldDependencies. See the screenshot below. Link to comment Share on other sites More sharing options...
gornycreative Posted March 8 Share Posted March 8 I'm sorry I should have been clearer. I haven't tried your module yet, I was just trying to use the core method (which wasn't working for me) and I was asking if your extended module would perform in a way that the default setup did not. I will give it a try. 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