V8 - Include page / file selector to dynamically created faq entries inside block

Permalink
Does anyone have an example how to include a page / file selector inside the ccm-faq-entry-template? Its something similar to the image_slider I guess but the faq block is set up differently.

This does dynamically add new "entries/slides" with a preset template.
For static text this works fine but would like to have the page / file / image / cke fields available too.

1 Attachment

c5dragon
 
c5dragon replied on at Permalink Reply
c5dragon
Anyone who could shine a light on this?
mnakalay replied on at Permalink Reply
mnakalay
page selector
$ps = \Core::make('helper/form/page_selector');
echo $ps->selectPage('yourPageSelectorIdentifier', $yourPageSelectorExistingValue);


Image selector
$fs = \Core::make('helper/concrete/asset_library');
echo $fs->image(yourUniqueImageSelectorIdentifier', 'yourSelectorInputName', t('A label for your input'), $yourImageSelectorExistingValue);

Note that for the image selector to work you will have t load the file manager asset by doing this from your controller:
$this->requireAsset('core/file-manager');
mnakalay replied on at Permalink Reply
mnakalay
Actually I am wrong on that last part, you do not need to load the file manager asset, at least in 8.4.4
c5dragon replied on at Permalink Reply
c5dragon
Attached code (zip) to original post.

It does open the sitemap to select a page.
But the dynamic 'add entry' is the problem and wont pick up the value.
c5dragon replied on at Permalink Reply
c5dragon
Any insight on this one?