Soma Posted October 1, 2013 Share Posted October 1, 2013 Ryan, so showing or hiding a repeater isn't supported? I'm NOT using dependecies in the repeater but to show/hide the complete repeater. Again, I have this setup, with a checkbox to toggle a fieldset and a repeater (also a fieldset no?) I have a simple checkbox checked : show repeater / hide other fieldset unchecked: hide repeater / show other fieldset Multilanguage installed. Repeater has also multilanguage title. But I don't think it has to do this it. Can anybody reproduce this pls? Lately anything I report, Ryan doesn't seem to be able to reproduce. :/ ---- Required option: The required option for a repeater field was always there, it has nothing to do with dependencies. But it doesn't work with them to set a repeater required. Link to comment Share on other sites More sharing options...
ryan Posted October 5, 2013 Author Share Posted October 5, 2013 Ryan, so showing or hiding a repeater isn't supported? I'm NOT using dependecies in the repeater but to show/hide the complete repeater. Again, I have this setup, with a checkbox to toggle a fieldset and a repeater (also a fieldset no?) Soma, I still can't duplicate this one. Tell me if I'm not setting it up correctly. I have a field called "Test Toggle" that when checked shows my repeater. When unchecked, it shows another fieldset called "Test Fieldset" (which itself contains a single text field). See the screenshots that demonstrate the checked and unchecked state of "Test Toggle". The "show if..." rule I've attached to my "rates" repeater is test_toggle!='' and the rule I've attached to my "Test Fieldset" is test_toggle=''. This site already had multi-language enabled. The screenshots don't show it, but I also tried adding a multi-language title field to the repeater, just in case. But that didn't make any difference. test_toggle unchecked (test_fieldset shown): test_toggle checked (test_fieldset hidden and rates repeater shown): Can you think of anything else I should try? Link to comment Share on other sites More sharing options...
Nico Knoll Posted November 6, 2013 Share Posted November 6, 2013 Hey, is it already possible to use it? Greets, Nico Link to comment Share on other sites More sharing options...
owzim Posted November 8, 2013 Share Posted November 8, 2013 I am using the Futura remixed theme and the admin columns module, and before I added the inputfield.js like stated here http://processwire.com/api/selectors/inputfield-dependencies/ the widths of the columns where set fine, like 70% and 29%. No with the newly added JS the width are very weirdly huge: 98.65625% and 57.65625%What's wrong and how to fix it? Link to comment Share on other sites More sharing options...
owzim Posted November 8, 2013 Share Posted November 8, 2013 I cannot use parent=1 or parent.template=home as a dependency in the visibility option right? Because it does not work for me. =( Also not in the default admin theme. Link to comment Share on other sites More sharing options...
ryan Posted November 9, 2013 Author Share Posted November 9, 2013 I am using the Futura remixed theme and the admin columns module, and before I added the inputfield.js like stated here http://processwire.c...d-dependencies/ the widths of the columns where set fine, like 70% and 29%. No with the newly added JS the width are very weirdly huge: 98.65625% and 57.65625% The new inputfields.js from the dev branch will attempt to maximize the row with the columns that are in it. If the total does not add up to 100%, it will expand the last visible column to fill the row. I'm guessing this is what you are seeing? This behaves well with the default admin themes (both old and new), but I've not tried Futura Remixed yet. It's possible that theme may need an update if it's not something we can work around. I cannot use parent=1 or parent.template=home as a dependency in the visibility option right? Because it does not work for me. =( Also not in the default admin theme. Dependencies are the field names are they are in the markup (id attributes). While I've not tried it, you may be able to get it to work just by using the parent field as it's named in the markup, which is "parent_id". However, you could only match the ID (number), you couldn't match something like parent_id.template=home. Link to comment Share on other sites More sharing options...
owzim Posted November 9, 2013 Share Posted November 9, 2013 Thanks for the reply ryan. I now use the new default theme with futura colors anyway. Link to comment Share on other sites More sharing options...
Alfred Posted November 25, 2013 Share Posted November 25, 2013 Is there a way to make the values of one dropdown dependent on the chosen value of the other dropdown? For example if I choose in a country dropdown "France" the second City dropdown will show "Paris, Marseille, Lyon, Toulouse etc." Thanks Alfred Link to comment Share on other sites More sharing options...
apeisa Posted November 25, 2013 Share Posted November 25, 2013 only by creating multiple fields for cities. like cities_in_france, cities_in_finland etc and show/hide them based on country selection. 1 Link to comment Share on other sites More sharing options...
Alfred Posted November 26, 2013 Share Posted November 26, 2013 Thanks Apeisa for your reply. I will use your suggested solution. Link to comment Share on other sites More sharing options...
Martijn Geerts Posted November 26, 2013 Share Posted November 26, 2013 (edited) It's hackish, but something may work. When you select the first select, trigger a click on the save button with javascript ( needs a module ) Then after page save, the other select ( type of page ) uses the data from the first select to query the 'sub' pages Show the second select only when the first one is not empty with field dependencies. Forget this, this is not very thoughtful. Edited November 26, 2013 by Martijn Geerts Link to comment Share on other sites More sharing options...
Soma Posted November 26, 2013 Share Posted November 26, 2013 This would be a good candidate for a simple custom field, nuff said. 1 Link to comment Share on other sites More sharing options...
ryan Posted November 30, 2013 Author Share Posted November 30, 2013 Is there a way to make the values of one dropdown dependent on the chosen value of the other dropdown? For example if I choose in a country dropdown "France" the second City dropdown will show "Paris, Marseille, Lyon, Toulouse etc." Actually, you can do this on the dev branch. Lets assume that cities are children of countries and that is reflected in your page structure (i.e. /countries/france/paris/). Create your 2 page fields (country and city), and configure 'country' as a single page field with "parent" set to "/countries/". Next, for the "city" field configuration, use the "Custom selector to find selectable pages", present on the "input" tab. In that field, enter "parent=page.country". Save and try it out. This works with select, selectMultiple and asmSelect fields (and possibly others), though not yet with checkboxes, radios or PageListSelect. 19 Link to comment Share on other sites More sharing options...
Pete Posted November 30, 2013 Share Posted November 30, 2013 That's really great ryan - I need this for something I'm doing right now Link to comment Share on other sites More sharing options...
Alfred Posted November 30, 2013 Share Posted November 30, 2013 Thank you Ryan. PW keeps amazing me. I tested it and it works like a charm. One thing though. Is it also possible within a repeater field? I tried it with this selector: parent=page.name-repeaterfield.country but it is probably missing the individual repeater field (or maybe is it not possible at all this way). Link to comment Share on other sites More sharing options...
titanium Posted December 5, 2013 Share Posted December 5, 2013 Dependencies are the field names are they are in the markup (id attributes). While I've not tried it, you may be able to get it to work just by using the parent field as it's named in the markup, which is "parent_id". However, you could only match the ID (number), you couldn't match something like parent_id.template=home. This selector does not work for me, for instance: parent_id=1050 Is there any other way to show a field depending on the parent? (The selector id=1050 works, so it's no problem to show a field depending on the id of the current page. But I need the parent.) Link to comment Share on other sites More sharing options...
Pete Posted December 5, 2013 Share Posted December 5, 2013 It would also be awesome if we could match things like parent.template in the future as well. Link to comment Share on other sites More sharing options...
renobird Posted December 10, 2013 Share Posted December 10, 2013 Ryan, I've been experimenting with this a lot — and it's really solid. I can't imagine not having it now. The only thing I can't sort out (it may not be possible) is how to hide a page field if it returns no results. For example: I have a page field that is a sidebar picker. It uses a custom selector to look for a sibling page named "sidebars". There isn't a always "sidebars" page defined in every parent, so sometimes the page field is empty. That can be confusing, so I was hoping I could hide the page field if there are no options available. I may need a simple module for this instead, but thought I would ask if it's possible dependencies. Link to comment Share on other sites More sharing options...
ryan Posted December 24, 2013 Author Share Posted December 24, 2013 This selector does not work for me, for instance: parent_id=1050 Is there any other way to show a field depending on the parent? I can confirm, this doesn't seem to work for me either. I'm not yet sure why it doesn't work, but will look into this. There isn't a always "sidebars" page defined in every parent, so sometimes the page field is empty. That can be confusing, so I was hoping I could hide the page field if there are no options available. Currently dependencies can't check if there are options available in a selection field... it can only tell if something is selected and what is selected. I'm not really sure how I'd suggest solving that particular issue, short of a custom module. But for starters, it might be good to set the visibility state of the field to "collapsed only when blank", which should help to keep it out of the way until needed. 1 Link to comment Share on other sites More sharing options...
adrian Posted February 1, 2014 Share Posted February 1, 2014 Just had a reason to play with this via the API for the first time. Adding some config fields to a module and I just have to say WOW! It's just too easy Thanks again to Ryan for the great work and Avoine for sponsoring! 1 Link to comment Share on other sites More sharing options...
ceberlin Posted March 3, 2014 Share Posted March 3, 2014 Hi, I did not find that mentioned before, there is another limitation of field dependencies. Chains do not work (yet). example: field1, field2(hidden), field3(hidden): 1. Display field2, if field1 has a string -> works! 1. Display field3, if field2 has a string -> works NOT, if field1 is still empty and therefor field2 is still hidden, error: Session: Max number of iterations reached for processing field dependencies (ProcessPageEdit) Link to comment Share on other sites More sharing options...
bigbeee Posted March 13, 2014 Share Posted March 13, 2014 I can confirm, this doesn't seem to work for me either. I'm not yet sure why it doesn't work, but will look into this. Currently dependencies can't check if there are options available in a selection field... it can only tell if something is selected and what is selected. I'm not really sure how I'd suggest solving that particular issue, short of a custom module. But for starters, it might be good to set the visibility state of the field to "collapsed only when blank", which should help to keep it out of the way until needed. Hey, its because parent_id form field ID isnt prefixed with "Inputfield_" as all other formfields. It simply has the id="parent_id", so this selector doesnt match: var $field = $("#Inputfield_" + condition.field); Dont know if something else breaks if the form field ID is prefixed. Cheers Link to comment Share on other sites More sharing options...
suntrop Posted May 4, 2014 Share Posted May 4, 2014 I was just wondering if it is possible to use roles as dependency? I've read Ryans post https://processwire.com/talk/topic/4323-field-dependencies/page-3#entry42957 and thought it might be possible. Link to comment Share on other sites More sharing options...
Pete Posted May 7, 2014 Share Posted May 7, 2014 I've tried using field!='' for a Page field that displays two radio buttons and it doesn't seem to work. I also tried !=0 and >0 but no joy. Basically I don't want to show a field unless one of the radio options is clicked, and by default neither is, but this scenario just doesn't seem to work with dependencies at present. Any suggestions? Link to comment Share on other sites More sharing options...
Soma Posted May 7, 2014 Share Posted May 7, 2014 It does only work with a specified id radio=1002 1 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