widgetfactory / jce-legacy

JCE - A Content Editor for Joomla!
4 stars 2 forks source link

Media form field type and JCE file browser #7

Open esedic opened 8 years ago

esedic commented 8 years ago

I want to use plugin for displaying custom fields in article form in administration. I've tried DPFields and T3 framework - latter also has support for article custom fields. As far as I know, both are coded by Joomla API standards, using proper events, etc.

I've created media form field type, because I want to display PDF documents in articles. When I open article, custom field is visibile, this is where JCE plugin takes over - when I click browse button, JCE File browser is opened instead of Joomla Media manager.

In this case, PDF files (or any other file types except images) are not visible. If I use JCE File browser for example from Control panel, PDF files are visible, which also suggests (and I've checked) that PDF file type is allowed in Joomla Media Manager settings and in JCE settings.

I'm not exactly sure, if it's a Joomla Media Manager, JCE or 3rd party plugin issue.

Here is JCE File browser when accessed from standard icon: jce_default

And here is JCE File browser when accessed through media form field type in article: jce_custom

esedic commented 8 years ago

I've compared links and noticed that in URL of a custom field there is a value filter=images. I traced it to administrator/components/com_jce/models/model.php. For testing purposes I've changed $url in line 125 from $url .= '&filter=' . $filter; to $url .= ''; and now pdf files are displayed.

ryandemmer commented 8 years ago

This will be addressed in the next update with an option to set a "filter" field attribute

https://github.com/widgetfactory/jce/commit/6d2046fd3f591010136f0b2b15b3726a32595adf

digitecmedia commented 8 years ago

Hi @esedic . I need the same you achieved: how I can do to show JCE File Browser in a media custom field instead Joomla Media Manager?. Thanks a lot.

digitecmedia commented 8 years ago

Hi @esedic . I need the same you achieved: how I can do to show JCE File Browser in a media custom field instead Joomla Media Manager?. Thanks a lot.

ryandemmer commented 8 years ago

This can be done with JCE 2.5.20 or later and Joomla 3.6+ using a JFormField field, eg:

<field name="image"
type="media"
label="My Label"
description="My Description" />