You need a form.xml with type repeatable. In it a type media.
EXAMPLE:
<field name="gallery_news"
type="repeatable"
icon="list"
description="KICKCCK_FIELD_NEWS_GALLERY_LABEL"
label="KICKCCK_FIELD_NEWS_GALLERY_DESC"
default=""
maximum="9"
>
<fields name="params">
<fieldset hidden="true" name="list_news_gallery" repeat="true">
<field name="gallery_image"
type="media"
directory="newsimage"
label="KICKCCK_FIELD_NEWS_GALLERYIMAGE_LABEL"
description="KICKCCK_FIELD_NEWS_GALLERYIMAGE_DESC"
preview="true"
/>
<field name="gallery_alt" type="text"
size="40" label="KICKCCK_FIELD_NEWS_GALLERY_ALT_LABEL"
description="KICKCCK_FIELD_NEWS_GALLERY_ALT_DESC"
/>
<field name="gallery_lightbox"
type="radio"
default="1"
label="KICKCCK_FIELD_NEWS_GALLERY_LIGHTBOX_LABEL"
description="KICKCCK_FIELD_NEWS_GALLERY_LIGHTBOX_DESC"
>
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
</fieldset>
</fields>
</field>
If you click on Select Image Button it dosen't open the Modal Window with the com_media component.
I know the type repeatable ist deprecated. The PROBLEM is the ISIS Backend Template.
Rename these file and it works.
Maybe these file need an update
Joomla 3.7
The problem is that JQuery live problem with the DOM.
I add these CODE to repeatabel.js
// fix media field in ISIS Template
$row.find('.field-media-wrapper').each(function(){
var $el = $(this);
$el.fieldMedia();
});
Status | New | ⇒ | Discussion |
I can confirm this issue. It's rather frustrating that things were working perfectly fine in Joomla 3.6.5 and then once update to 3.7.x the "Select" button does not work anymore.
Joomla 3.7.2
PHP 7.0.8
Again, this media field inside a repeatable field worked just fine in Joomla 3.6.5.
Can confirm this for latest Joomla! 3.7.2, with 3.6 it worked. Above hack by @nielsnuebel (inserting code into repeatable.js) fixed the problem. Shouldn't we create a PR for this?
Please do create the PR.
Hi, at wicth line into repeatable.js i had to add nielsnuebel's code? beacuse i add it at the end (before "})(jQuery);") and it not works. Can you help me please? (Sorry for my poor english)
Status | Discussion | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-07-21 14:08:34 |
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/15917
closed as having PR #17205
HI ,
I have the same problem occurred. Now I have fixed my problem.
Below are the steps
Go to the below directory
administrator\templates\isis\html\layouts\joomla\form\field
and remove/rename "media.php"
@jinbullsushil can you please test #17205?
The solution proposed by @jinbullsushil solves the problem perfectly.
Why has the bug not yet been solved officially since the solution was proposed in August?
@fede91it - A PR has been submitted, so please feel free to test and mark your result.
2 successfull tests are required for it to be merged.
Else if it doesn't work, you could submit a new PR to remove that file as suggested by @jinbullsushil
The PR #17205 is no longer working with a repeatable field + modal_article
-field. Tested on Joomla V3.8.8
<!-- Fieldset: Dock -->
<fieldset name="dock" label="Dock">
<field name="dock_links" type="repeatable" icon="link" label="Links">
<fieldset hidden="true" repeat="true" addfieldpath="/administrator/components/com_content/models/fields">
<field name="name" type="text" label="Name" description="Social Name" filter="text"/>
<field
name="article"
type="modal_article"
label="Select an article"
select="true"
edit="false"
clear="true"
/>
</fieldset>
</field>
</fieldset>
<!-- ./Fieldset: Dock -->
Problem being is BS2 doesn't support multiple modals being open at once. I believe this was one of the reasons why subform fields were created.