Use it in an article :
You can select the PDF file uploaded through the Media Custom Field because it is accepted and store by the Media Manager.
You succeed to upload the PDF file through the Media Custom Field (you can verify it by the Media Manager)
But you can not see it nor select it through the Media Custom Field.
dbversion: 5.7.14
dbcollation: utf8_general_ci
dbconnectioncollation: utf8mb4_general_ci
phpversion: 7.0.10
server: Apache/2.4.23 (Win64) PHP/7.0.10
sapi_name: apache2handler
version: Joomla! 3.8.5 Stable [ Amani ] 6-February-2018 15:00 GMT
platform: Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT
useragent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 Safari/537.36
Status | New | ⇒ | Duplicate Report |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-03-21 06:12:16 |
Closed_By | ⇒ | franz-wohlkoenig |
Status | Duplicate Report | ⇒ | Closed |
Closed_Date | 2018-03-21 06:12:16 | ⇒ | 2018-03-21 06:12:17 |
Closed_By | franz-wohlkoenig | ⇒ | joomla-cms-bot |
closed as duplicate Report.
Set to "closed" on behalf of @franz-wohlkoenig by The JTracker Application at issues.joomla.org/joomla-cms/19954
Guys, there are so many Issues regarding the possibiliy to select other files types in a modal-window like the media-type allows it, but all the ones that i came accros and read are closed because "duplicate of xy" or "use another field-type".
As you can see in this conversation #10871 there IS a need to use a modal-window for not only uploading files but also select them after upload. The file-type-field is not a proper solution for this (because you have to upload a file again which might already be on the server - please don't suggest to use 2 fields: file and filelist :-D ).
So: Where is the issue that we can talk about this feature? Please add a link to all the closed ones.
@Robdebert thanks for your Comment, but Comments on closed Issues didn't get much Notice. So i suggest to open an new one.
Please add a link to all the closed ones.
i guess you know but to be sure: open https://github.com/joomla/joomla-cms/issues?q=is%3Aissue+is%3Aclosed
Thanks for your answer.
But can we not just re-open this issue? Because there is already a lot of information here. Opening a new one will only create the next issue to the same topic, that already exists (in this and other issues, that where created).
Status | Closed | ⇒ | New |
Closed_Date | 2018-03-21 06:12:17 | ⇒ | |
Closed_By | joomla-cms-bot | ⇒ |
Closed_Date | 0000-00-00 00:00:00 | ⇒ |
Set to "open" on behalf of @franz-wohlkoenig by The JTracker Application at issues.joomla.org/joomla-cms/19954
Reopened as stated above.
Status | New | ⇒ | Discussion |
Labels |
Added:
J3 Issue
|
In Joomla 4 uploading pdf is enabled by default, but not rendered on the frontend.
Changing plugins/fields/media/tmpl/media.php from:
...
if (!$path)
{
continue;
}
$buffer .= sprintf('<img src="%s"%s>',
htmlentities($path, ENT_COMPAT, 'UTF-8', true),
$class
);
...
To:
...
if (!$path)
{
continue;
}
if(substr($path, -4) == '.pdf')
{
$parts = explode('/', $path);
$buffer = ''. $parts[1] .'';
} else {
$buffer .= sprintf('<img src="%s"%s>',
htmlentities($path, ENT_COMPAT, 'UTF-8', true),
$class
);
}
...
Did the trick for me: https://gridx.joomla.com/
Both are Media fields and Download renders without preview (No) in frontend editor.
The same is done in Joomla 3 without automatic display, custom fields and rawvalue.
In my opinion (pre)setting the images/files/docs folders should work in most cases.
Thanks
With href:
if (!$path) { continue; } if(substr($path, -4) == '.pdf') { $parts = explode('/', $path); $buffer = '<a href="'. $path .'" target="_blank" rel="noopener">'. $parts[1] .''; } else { $buffer .= sprintf('', htmlentities($path, ENT_COMPAT, 'UTF-8', true), $class ); }
With href:
if (!$path) { continue; } if(substr($path, -4) == '.pdf') { $parts = explode('/', $path); $buffer = '<a href="'. $path .'" target="_blank" rel="noopener">'. $parts[1] .''; } else { $buffer .= sprintf('', htmlentities($path, ENT_COMPAT, 'UTF-8', true), $class ); }
Attached improved code to always get the end-path from different files folders. https://gridx.joomla.com/
Changing plugins/fields/media/tmpl/media.php to:
foreach ($value as $path)
{
if (!$path)
{
continue;
}
if(substr($path, -4) == '.pdf')
{
$file = explode('/', $path);
$buffer = '<a href="'. $path .'" target="_blank" rel="noopener">'. end($file) .'</a>';
} else {
$buffer .= sprintf('<img src="%s"%s>',
htmlentities($path, ENT_COMPAT, 'UTF-8', true),
$class
);
}
}
@martyharty can you do a Pull Request - https://extensions.joomla.org/blog/item/how-to-contribute-to-joomla-through-github/ ?
Status | Discussion | ⇒ | Information Required |
@franz-wohlkoenig can I do this if @martyharty doesn't have any problem
@hardik-codes sure.
Please go ahead. I noticed setting a files path on Media Field is not accessible from frontend. Check with user(name) and pass(word) on https://gridx.joomla.com/ (default images path is no problem).
Regarding Joomla 4 it seems the System - Privacy Consent plugin is not redirecting user on frontend login.
Also saving Content Fields on backend: An error has occurred. 0 Class 'FieldsHelper' not found.
One more thing. The Joomla 4 alpha on https://launch.joomla.org/ is set to daily renewal which means the site is lost in one day... monthly as default - like cloudaccess - works better I guess.
Thanks
@hardik-codes new Features goes only in J4
@martyharty please report the Request at CloudAccess.
@franz-wohlkoenig so I have to make a PR for 4.0-dev ?
yes, there are only Bugfixes in J3.
Status | Information Required | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-04-02 09:38:40 |
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/19954
Status | Closed | ⇒ | Pending |
Closed_Date | 2019-04-02 09:38:40 | ⇒ | |
Closed_By | joomla-cms-bot | ⇒ |
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2021-06-30 17:49:08 |
Closed_By | ⇒ | Quy |
Duplicate #10871.
Short answer: Media custom field is for images only.