-
-
Notifications
You must be signed in to change notification settings - Fork 212
Link Files for Image #5863
Comments
Why don't you use the link element instead? |
There i´m not able to pick file from Filemanager as well?! |
today on an other project forced this issue again. |
Still a big issue for my Contao users. So +1 for the idea. |
This issue still bothers me (and my customers). In tinyMCE the switch from file to site chooser is already implemented. Can this be done for the link and download elements as well? |
I came up with the following workaround: I created a if (!class_exists('tl_dcaconfig')) {
$GLOBALS['TL_DCA']['tl_content']['fields']['url']['eval']['filesOnly'] = true;
$GLOBALS['TL_DCA']['tl_content']['fields']['url']['wizard'][] = array('tl_dcaconfig', 'filePicker');
class tl_dcaconfig
{
/**
* Return the file picker wizard
* @param \DataContainer
* @return string
*/
public function filePicker(DataContainer $dc)
{
return ' <a href="contao/file.php?do='.Input::get('do').'&table='.$dc->table.'&field='.$dc->field.'&value='.$dc->value.'" title="'.specialchars(str_replace("'", "\\'", $GLOBALS['TL_LANG']['MSC']['filepicker'])).'" onclick="Backend.getScrollOffset();Backend.openModalSelector({\'width\':768,\'title\':\''.specialchars($GLOBALS['TL_LANG']['MOD']['files'][0]).'\',\'url\':this.href,\'id\':\''.$dc->field.'\',\'tag\':\'ctrl_'.$dc->field . ((Input::get('act') == 'editAll') ? '_' . $dc->id : '').'\',\'self\':this});return false">' . Image::getHtml('pickfile.gif', $GLOBALS['TL_LANG']['MSC']['filepicker'], 'style="vertical-align:top;cursor:pointer"') . '</a>';
}
}
} This adds a file picker button next to the page picker button. Any improvements are welcome. |
Fixed in contao/core-bundle@46ee448. Needs to be back ported. |
Back ported in 18010b5. |
Fixed the other pickers, too, in b2641f1. |
Would be good to be able to choose file for Image.
As Sample i have an image and want to link it to an pdf in files. At the moment i can only choose a page but not a file to be linked by image.
At the moment this link must be set manually.
The text was updated successfully, but these errors were encountered: