We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Issue with custom fieldtype trying to use CP/FilePicker in grid field

Development and Programming

whitespace's avatar
whitespace
4 posts
8 years ago
whitespace's avatar whitespace

Hi,

I’m trying to port an EE2 plugin I created to EE3.

I’ve got the vanilla fieldtype working fine but I’m having an issue when trying to get it to work in a grid field.

In my display_field method I have the following code:

$file_picker_link = ee('CP/FilePicker')->make()
     ->setDirectories($allowed_directory)
     ->getLink(lang('wscropper:select_file'))
     ->setAttribute('class', 'btn action ws-cropper-load-filepicker')
     ->asThumbs()
     ->enableFilters()
     ->enableUploads()
     ->render();

...


$fdata['file_picker_link'] = $file_picker_link;
return ee('View')->make('wscropper:ft_display')->render($fdata);

and in my view I have:

<?php echo $file_picker_link; ?>

When I click the file upload link I just get a blank modal.

If I have a vanilla version of my field in the field group and click the link then the modal works fine and then I can click on my grid field version of the link and it works. Gif of that here:

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.