Joomla 3.7
I initially opened this issue in the custom field repo and @laoneo suggested me to post this on CMS repo as this issue more related to media form field (which is missing this configuration option) rather than custom field
Sorry to be passing you from pillar to post but its not a problem with the core field type. the problem is that custom fields is using one field type when there should be two
Labels |
Added:
?
|
Would it be an option to allow more file extensions than images for the new media manager?
Media Manager already does - You can see right now that Media Manager will
display pdf files.
What you are seeing in the Modal in this example is not the full media
manager but a subset to display images - which is the file type supported
by the media field.
(On my phone right now so cant double check but pretty sure that if you use
the core FILES field then the modal selector will show the pdf as well)
On 20 June 2016 at 10:52, Allon Moritz notifications@github.com wrote:
Would it be an option to allow more file extensions than images for the
new media manager?—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#10871 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/ABPH8Z47wdGwa1fESXUaPYGPCJSLJsVLks5qNmL6gaJpZM4I5gFp
.
Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/
The problem is that you only have a Media field type in Custom Fields - if you look at the tooltips for that field in Custom Fields you can see it is for images only.
You just need to have another field type in Custom Fields for files
The file field type, allows to select only an existing file from the filesystem. What @webchun wants, is the full media manager functionality (upload) for none image files.
I'v just tested it and uploaded a PDF trough the media manager. It is not displayed in the media manager. If this is possible already, then there are undocumented attributes for the media manager XML definition here https://docs.joomla.org/Media_form_field_type which should be supported by custom fields, which would then make this issue obsolete.
The file field type, allows to select only an existing file from the filesystem.
That is not true. The documentation clearly says that AND if you think the documentation is wrong then you just need to see that com_joomlaupdate uses a field with type="file"
That's the media manager from Articles which opens with the default view. The one which is opened trough the form field adds a view=imagesList parameter to the url of the iframe which shows only the images. If this would be a configurable option, then we can add a parameter in custom fields. Before this is done, it's not possible.
That is not true. The documentation clearly says that AND if you think the documentation is wrong then you just need to see that com_joomlaupdate uses a field with type="file"
Don't know where to find it.
That's exactly why I said to read what I have already written.
You'd have to rewrite the media field and media manager.
The media field uses the images view of the admin com_media component and if you follow its traces around long enough you'll find that the inner iframe's contents are populated by a method that explicitly filters to display only images.
@brianteeman is correct here the modal doesn't have a handler for pdf's and videos although these appear correctly in the component media. Nothing to do with custom fields
The problem is that custom fields does NOT have a field type of files
It only has a field type of media
Problem is resolved by adding the files field type
Sorry if I wasnt clear enough 3 hours ago
Problem is resolved by adding the files field type
It's actually the "filelist" field type. And that's one workaround, but that field type is a select list only. If the intent is a full UI similar to the media field, then as I said com_media and the media field itself need updates.
Why is it not the file field type https://docs.joomla.org/File_form_field_type
Why is it not the file field type https://docs.joomla.org/File_form_field_type
As I said, this allows to select only a file form the filesystem of an existing list, nothing to upload. Create a file custom field and you will see what I mean.
No. It lets you upload a file
Just for the record, the line we are talking about can be found here https://github.com/joomla/joomla-cms/blob/staging/layouts/joomla/form/field/media.php#L174 which has the view parameter imageList hardcoded.
No. It lets you upload a file
True, sorry was on that field https://docs.joomla.org/Filelist_form_field_type.
I did give you the link three hours ago #10871 (comment)
Are we all on the same page finally?
I guess we can introduce a param for file types (in case not defined only images will be displayed B/C) and mix in the new views in the new media component. In such case custom fields will need minor adjustment.
Would fix the problem. We would be able then to use the media manager to upload and select none image files.
Category | ⇒ | Fields |
As suggested by @brianteeman I think adding a new custom field type (file) is sufficient for the basic need to upload + include a file / attachment in an article. I was actually trying to find the 'file' type of custom field before trying the media field but I can not find it, so I tried media.
The file field does only show a file upload box. IMO the media manager is the way to go.
The file field does only show a file upload box. IMO the media manager is the way to go.
Yes, this would be the ideal option, because it will also let us to pick (existing) files easily, but I'm not sure how complicated is it to implement it.
But for the basic uploading file's need, I think 'file' type field is sufficient
@laoneo you mean to get a js uploader for field file? It shouldn't be hard to do but honestly I am against it as all these scripts might fail on several browsers for any reason so the native browser button is a better solution. We can style that better if we want, or have a template override for it (it's using JLayout now I think) and integrate any uploader. But in short if you propose to override the native browser functionality for a js uploader, in this case, I am against that.
I was referring to your solution here #10871 (comment). No need for a JS uploader functionality. That would help to solve this issue, as we can then allow more file types than only images in the media form field.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-08-03 16:50:51 |
Closed_By | ⇒ | brianteeman |
That was an interesting conversation but at the end of the day it is just simply using the wrong field type. Closed
No, it's not. There is a parameter missing in the media form field, which is adressed by this issue. Please reopen this issue.
Status | Closed | ⇒ | New |
Closed_Date | 2016-08-03 16:50:57 | ⇒ | |
Closed_By | brianteeman | ⇒ |
Reopened as requested
I can't really remember, but I think the view parameter which is hardcoded here https://github.com/joomla/joomla-cms/blob/staging/layouts/joomla/form/field/media.php#L174 needs to be configurable. I think I was mention it here #10871 (comment).
That's what we try to solve here. But with the new media manager it is planed to support multiple file types better in the future. So I guess we can close this one for now.
Hi All.
Sorry I am not an advanced user of Joomla 3.7 and I understand it is stable enough to be used on commercial projects.
However attaching Files is of massive importance. I understand the fields at the moment can only have media files attached, ie images. However, I would like to add files. I understand from @brianteeman comment that there is a file type found at this link:
https://docs.joomla.org/File_form_field_type
But how do we get to add this to the list of field items ?
What file to add it to ?
First, 3.7.0 is not stable yet and should not be used in production. It's beta.
Attaching a file needs much more code than just a daabase entry. You need to upload the file and store it somewhere, doing some additional security checks during that process.
Such a field doesn't exist in core.
@laoneo should this Issue closed caus no file-field-Plugin is in 3.7?
Status | New | ⇒ | Information Required |
yes
Status | Information Required | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-04-06 15:57:55 |
Closed_By | ⇒ | franz-wohlkoenig |
Closed_By | franz-wohlkoenig | ⇒ | joomla-cms-bot |
Set to "closed" on behalf of @franz-wohlkoenig by The JTracker Application at issues.joomla.org/joomla-cms/10871
closed as Issue resolved, thanks for Info @laoneo
closed as Issue resolved, thanks for Info @laoneo
This is a bummer, but I discovered that if you're running JCE, it bypasses this issue as you get THEIR media manager replacement which DOES support PDFs.
Still, it would be nice to get a real file/attachment field eventually. It could be set to allow certain file types (like media manager does) and an option to use a root folder that the user can't browse OUT of (for security purposes). Maybe I'll look into having someone write such a plugin, but for now, using JCE totally gets around the limitation. Just putting that out there in case someone stumbles on this thread.
@brianteeman can you please open a new Issue or write on an open Issue? Less People will read closed issues, thanks.
Wrong brian
äh, sorry @brianteeman, meant @brianpeat :-)
Actually I want my comment left on this ticket because I had the issue and when I googled it, this issue came up. If someone else hits the same issue, at least now if they find this, they'll have a work around.
Really should be able to upload/select PDF files and Video files when using a custom field. When you directly access the Media Manager via the Administrator area, you can upload PDF and Video files. But there is no capability in Joomla, even now with custom fields to be able to upload/select a PDF or Video file outside the media manager. JCE is out of the question for me.
I don't even need it embedded in the article like an image, I just need the field so I can then manipulate the template file on how to display the field within the article.
I have people that are wanting to attach video files to an article when they create them on the front end. And even with the addition of custom fields this is still impossible to do.
If someone knows how to do this using the custom fields please direct me there.
I am using Joomla 3.7.5, and creating custom fields to be filled in when creating a new user. I would like to upload a PDF, however the field type that is being referred to in this thread 'file' is not available when creating the new field, it does not appear in the dropdown list of available field types. How would I go about adding this 'field' field type to the dropdown list?
So was the end result of this that you can't upload PDFs using the Media field or any of the current OOB Extra fields? I mean yes you can "upload" a pdf but you cannot select it as it cannot be seen in the modal once uploaded. As far as I can see the only way to link to a non media file is to upload it using Media Manager and then type the relative url into a 'URL' field or 'Text' field. I do hope this functionality or the addition of the 'File' Field is considered in future updates of the Extra Fields feature which is already amazing.
You can upload PDF files using the Media field in the Modal. It is just after the upload, you get the successful message, but the PDF does not appear in the window for you to select. And since the input field that displays the path of the selected file is read only, you can not even manually type in the path to the PDF file.
I think people are requesting the ability to upload and link a PDF file on the fly when creating an article. Not having to before hand use the full blown media manager (which is impossible to do on the front end) to upload the PDF files, and then write down the path to be used when actually creating or editing the article. Even using the "filelist" field type would offer a quicker way to select the file name. You run into issues where that directory becomes filled with files, and or files are being uploaded to other directories.
We are looking for the modal to work the same way for PDF files as it does for images.
Hi there,
I face this problem and I test something to make possible to select a pdf file with the media field used in a repeatable subform in a component.
I just added a line in administrator/com_media/models/list.php
line 160 case 'pdf': (see screenshot)
It works fine even if it is not ideal to hack a Joomla core component, but couldn't the solution be so simple ?
Regards
Hi there,
I face this problem and I test something to make possible to select a pdf file with the media field used in a repeatable subform in a component.
I just added a line in administrator/com_media/models/list.php
line 160 case 'pdf': (see screenshot)
It works fine even if it is not ideal to hack a Joomla core component, but couldn't the solution be so simple ?
Regards
@Stereonomy can you please open a new Issue as Comments on closed Issues didn't get much Notice, thanks.
I don't see a content field of the type "file" in the Joomla core. Was this dropped?
In general I don't agree with the media content field type can't be used for PDF's as well. My resolution is simple - if the media manager can be used for PDF's (as it can), thus considering PDF's as "media". Then why can't a media type content field be used for PDF's?
@Stereonomy Your solution does seem to work as you can only choose the file, but after saving the article the choice is lost (only path remains)!
@Stereonomy My bad it now works. Think I had a firewall problem.
Can we rename it images if it doesn't accept media?
Can we rename it images if it doesn't accept media?
It can support media. The entire problem is architecturally the media field is hardcoupled to a view in com_media that explicitly filters every non-image media type out from the display. And nobody has bothered to sit down and come up with a solution that allows someone to use the media field to show all media types, or a custom filter if they're in a context where a custom list of types should be applied. Or, ya know, just rename the field to mask the fact that there isn't anybody skilled enough in PHP working on core to make the media field an actual media field and not a glorified image list.
Hi there,
I face this problem and I test something to make possible to select a pdf file with the media field used in a repeatable subform in a component.
I just added a line in administrator/com_media/models/list.php
line 160 case 'pdf': (see screenshot)
It works fine even if it is not ideal to hack a Joomla core component, but couldn't the solution be so simple ?
RegardsThis comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/10871.
Add to 200 line:
case 'pdf':
$tmp->width_60 = 32;
$tmp->height_60 = 32;
$tmp->icon_32 = 'images/mime-icon-32/' . $ext . '.png';
$tmp->icon_16 = 'images/mime-icon-16/' . $ext . '.png';
$images[] = $tmp;
break;
https://imgur.com/oQvGvqD
And edit /administrator/templates/isis/html/com_media/imageslist/default_image.php to 23 line
https://imgur.com/cDM6cKq
And finaly in module show icon
https://imgur.com/KZONw01
The media field type is designed for images (see https://docs.joomla.org/Media_form_field_type)
The one for files is the file field type ( see https://docs.joomla.org/File_form_field_type)
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10871.