Jump to content

Image & File Dependencies


Robin S
 Share

Recommended Posts

Image & File Dependencies

Allows Image and File fields to be used in inputfield dependency selectors. Note: prefix field names with an underscore in your dependency selectors.

Usage

Install the ImageFileDependencies module.

You can now create an inputfield dependency based on the number of images or files added to a Image or File field.

When you create an inputfield dependency for a Image or File field, prefix your field name with an underscore. Example for a field named 'images': _images>3
Note that you do not include a '.count' subfield in the selector.

https://github.com/Toutouwai/ImageFileDependencies

 

Demo
dep2.gif

  • Like 16
Link to comment
Share on other sites

  On 11/20/2016 at 10:28 PM, owzim said:

Can you name a use case?

Expand  

The use cases are the same as those for any inputfield dependency: you want to show or require one field based on the state of another. This module just adds Image and File fields to the types of fields you can use in an inputfield dependency selector.

Off the top of my head: you have an images field for an optional gallery and you want to remind the site editor to add a summary/introduction for the gallery if images are added. Also, there was this request for help.

@szabesz is right - the screen recorder tool is LICEcap. I discovered it via this post by @bernhard.

  • Like 4
Link to comment
Share on other sites

  • 8 years later...

Hello, is this module still necassary with newest PW ?

What ist actually the best way to show a text input field only if an image field ist populated? This image field is set to "single file if populated, null if not".  Additional the text input should be "required" if the image field is populated. 

Any help is appreciated...

Link to comment
Share on other sites

  On 4/6/2025 at 6:53 AM, planmacher said:

Hello, is this module still necassary with newest PW ?

Expand  

I'm not aware of anything changing that would make this module redundant, but it will be easy for you to check and find out.

  On 4/6/2025 at 6:53 AM, planmacher said:

What ist actually the best way to show a text input field only if an image field ist populated? This image field is set to "single file if populated, null if not".

Expand  

When using the Image & File Dependencies module, if your image field is named "image" you would use the selector string:

_image>0

 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...