Hi!
My FEU users need to upload PDFs. Unfortunately, there is only an "image" type of field availabe, which does not accept PDF ...
Any suggestions?
Is it possible to add "custom field types" to FEU?
Cheers,
Alex
FEU: how to upload PDF files?
-
uniqu3
Re: FEU: how to upload PDF files?
There is no "custom field type" for FEU, so to have a file upload field you would have to contact developer and ask him for that feature or you need to add it yourself, means unsupported "hacked" feature.
I would go with first option, paying for some feature which benefits other community is in my opinion better option than hacking a module and having to take care of same thing over and over again for each similar situation.
But it also depends how do you actually need this. Is it part of FEU user Profile or simply a upload area to upload and view files.
You could as well use Uploads module to allow uploading, Uploads module can already handle FEU groups, you would need to figure out a "per user solution" i wrote a article about similar situation http://www.i-do-this.com/blog/Adding-Up ... mically/57 if module functions and DB queries didn't change lately, this should still work.
You can sort and show Uploads module output by maybe following this post http://www.i-do-this.com/snippets/Sorti ... foreach/56
As long you figure out how you want your template and output built and find out which values you need to achieve it, it shouldn't be all to hard to figure out.
Another option is to look into JQuery File Upload module, sorry i didn't use it so can not say much about it.
Or handle file uploads with custom Form from a UDT or with FormBuilder.
You could use FormBuilder "Call a UDT with the Form Results" field to update FEU user profile, so in FEU you could simply create a "text" field that would hold value of PDF and submit that with FormBuilder using "File upload" field.
Recently i had to update FEU info based on submitted FormBuilder form values so maybe this UDT can help.
I had a hidden field with alias "useridentification" to get logged in User ID, you can find out ID variable with get_template_vars after FEU module tag call when a FEU user is logged in.
For things like this i usually add {FrontEndUsers form='silent'} on very top of my page Template so i have all FEU variables available anywhere in page Template.
Then where FormBuilder was called i used the fbrp_* parameter to insert FEU ID like {FormBuilder form='my_form' fbrp_MYID=$feuid} (where $feuid was my assigned variable)
Fields that i needed to update in FEU had same alias as FEU fields, therefore a simple foreach in UDT did the job.
If you want to handle multiple files per FEU user i guess Uploads module option would work, or you could as well use ListIt2 to handle "File Management", submitting and uploading files either with FormBuilder or jQuery File Upload (if module is capable of that) and saving results in LI2 based on FEU user ID.
Overall it relay depends how your uploaded files have to be handled.
I would go with first option, paying for some feature which benefits other community is in my opinion better option than hacking a module and having to take care of same thing over and over again for each similar situation.
But it also depends how do you actually need this. Is it part of FEU user Profile or simply a upload area to upload and view files.
You could as well use Uploads module to allow uploading, Uploads module can already handle FEU groups, you would need to figure out a "per user solution" i wrote a article about similar situation http://www.i-do-this.com/blog/Adding-Up ... mically/57 if module functions and DB queries didn't change lately, this should still work.
You can sort and show Uploads module output by maybe following this post http://www.i-do-this.com/snippets/Sorti ... foreach/56
As long you figure out how you want your template and output built and find out which values you need to achieve it, it shouldn't be all to hard to figure out.
Another option is to look into JQuery File Upload module, sorry i didn't use it so can not say much about it.
Or handle file uploads with custom Form from a UDT or with FormBuilder.
You could use FormBuilder "Call a UDT with the Form Results" field to update FEU user profile, so in FEU you could simply create a "text" field that would hold value of PDF and submit that with FormBuilder using "File upload" field.
Recently i had to update FEU info based on submitted FormBuilder form values so maybe this UDT can help.
I had a hidden field with alias "useridentification" to get logged in User ID, you can find out ID variable with get_template_vars after FEU module tag call when a FEU user is logged in.
For things like this i usually add {FrontEndUsers form='silent'} on very top of my page Template so i have all FEU variables available anywhere in page Template.
Then where FormBuilder was called i used the fbrp_* parameter to insert FEU ID like {FormBuilder form='my_form' fbrp_MYID=$feuid} (where $feuid was my assigned variable)
Fields that i needed to update in FEU had same alias as FEU fields, therefore a simple foreach in UDT did the job.
Code: Select all
// Load FrontEndUsers module
$FEU = cms_utils::get_module('FrontEndUsers');
if (!is_object($FEU))
return;
// Get User ID from FormBuilder $param
$userid = isset($params['useridentification']) ? $params['useridentification'] : 0;
if (!$userid)
return false;
// Update FEU User properties with FormBuilder $params
foreach ($params as $key => $value) {
$FEU->SetUserPropertyFull($key, $value, $userid);
}
Overall it relay depends how your uploaded files have to be handled.
-
faglork
Re: FEU: how to upload PDF files?
Many thanks! Most interesting stuff ...
I'll make a feature request.
So far, there is one quick-and-dirty solution:
In the FEU options, set the allowable image filetypes to gif,jpg,png,pdf
This will result in a broken thumbnail image, but everything else works!
I can live with that, since it will display the filename along with the broken thumbnail.
Cheers,
Alex
I'll make a feature request.
So far, there is one quick-and-dirty solution:
In the FEU options, set the allowable image filetypes to gif,jpg,png,pdf
This will result in a broken thumbnail image, but everything else works!
I can live with that, since it will display the filename along with the broken thumbnail.
Cheers,
Alex
