You need to be logged in to post in the forum - Log In

An active JCE Pro Subscription is required to post in the forum - Buy a Subscription

Support is currently Offline

Official support hours
Monday to Friday
09:00 - 17:00 Europe/London (BST)

Please create a new Ticket and we will get back to you as soon as we can.

#108490 Can't upload PDf with JCE in repeatable field

Posted in ‘Editor’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Latest post by Ryan on Monday, 31 January 2022 10:05 GMT

semaphore
Hi,
With the "new" override system, JCE is used instead of joomla manager but it's limited at the "image" one we can't select file option when used in a repeat context.
Any idea ?

Thanks

Ryan
When using the default Joomla Media Manager for a repeatable field, this too is limited to images only, so pdf files will not be displayed.

The JCE File Browser also defaults to images for media fields, and it is not possible when extending the repeatable field, to specify an option for the field to change this.

The JCE Media Field does have an option to set the display to files or images, but the Joomla repeatable field does not support non-core field types.

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

Ryan
Also, it should be noted that the Joomla Media Field, when displaying the media field item in the front-end, only supports images, not pdf or other file types.

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

semaphore
I have have try hacking core repeatable.xml (like in old days for adding jce media fields before you add the right way ^^) But even on adding this code for getting the fiel/image select

<field
								name="mediatype"
								type="combo"
								label="PLG_FIELDS_MEDIAJCE_PARAMS_MEDIATYPE_LABEL"
								description="PLG_FIELDS_MEDIAJCE_PARAMS_MEDIATYPE_DESC"
								showon="fieldtype:mediajce"
								>
								<option value="images">images</option>
								<option value="files">files</option>
										>
it's not enuph because I suppose we can't add a fieldparams like this. It's very annoying in 2021 we can't still easily create a simple form for adding PDF file + input for displaying a nice name in front with J! but's it's not your fault of course ^^

semaphore
We have tested with a quick hack, modifying administrator/components/com_media/models/list.php l.158 and adding pdf . It works for the core media not for JCE replacment.

Ryan
I'm going to be doing some tests on this in the next few days, and I think it can be done with a few field layout overrides, and a small change in JCE (which will bein the update tomorrow).

It basically involves changing the "view" value in the url in the media field layout, to view="files" (instead of view="images"), and then a change in the repeatable field front-end layout so that the PDF is rendered as a link.

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

Ryan
If you change view=images to view=files the url in a template override for the media field - https://github.com/joomla/joomla-cms/blob/3.10-dev/templates/protostar/html/layouts/joomla/form/field/media.php#L87 - you can get the Joomla Media Manager to list all files.

The JCE Pro 2.9.11 RC 4 - https://www.joomlacontenteditor.net/downloads/editor/pro/development - supports this change to display files in the File Browser, instead of just images.

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

Ryan
You need to change this in the admin template too for the back-end media field - https://github.com/joomla/joomla-cms/blob/3.10-dev/administrator/templates/isis/html/layouts/joomla/form/field/media.php#L87

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

semaphore
Yep yep yep ! tested and validate ! I make an override of the admin template and install the RC4 : Thanks so much ! When it will ready I will post the solution everywhere I see the issue (JCE media fields is in pro version only ?)

semaphore
I think I have play with too much things : now in my repeatable fields I have a media field but it don't all JCE Media manager when I create some content. How i have broke this ? (I have test with another website : media field in repeat call jce mediamanager)

Ryan
This is still working in my tests.

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

semaphore
My first issue is that JCE is not loading in repeat fields anymore instead of J media.

edit : I have re-upload a whole fresh isis/html folders : it's okay now i have JCE instead of J!media in repetable. I'm waiting for pdf file.

semaphore
Hi,
We still have issue after upgrade (of J! or JCe can't say). I know J!3 is not trendy anymore, but we still used it a lot here ^^ Do you still have this in your roadmap ?

Thanks

Ryan
There are no additional changes that can be made to JCE to support this. The template changes described above are required for the media field to support files other than just images.

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.