Jump to content

Recommended Posts

Posted

I've used page field visibility according to a select options value before with good results. But can't seem to get it to work with a file select field. Here's what I'm doing:

This all lives in a repeater. The file select (call it myFile) points to a folder and I can select files correctly.

Then there's a (call it description) field that should be if a specific file is selected on myFile (say x.php).

Editing the fields inside the repeater, `Show this field only if` is set to:

myFile="x.php"

I tried it with single or double quotes, with or without the `.php`, and the result is the same, the field is always hidden.

 

In previous similar implementations, I've used select options with a validation such as `myFile=1`, now I'm hoping to improve this method, excluding the need to update the files field every time something is added, and also make it a bit less cryptic to manage the fields' visibility.

Posted

Found the issue. To whoever it may concern, as of this day the select file fieldtype doesn't support being a condition for other field's visibility.

It's easy to hack though. On the module's file, find the render function and add the id property to the <select> element that it outputs, with $this->name as value. That will make it work

  • Like 1

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
  • Recently Browsing   0 members

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