diff --git a/documentation/configuration.rst b/documentation/configuration.rst index 7f533ec..03f095a 100644 --- a/documentation/configuration.rst +++ b/documentation/configuration.rst @@ -171,3 +171,6 @@ Use global setting No text Display no text. Only the thumbnail will be visible. + +Filename + Displays the filename \ No newline at end of file diff --git a/src/Form/ConfigForm.php b/src/Form/ConfigForm.php index dab5097..bf32725 100644 --- a/src/Form/ConfigForm.php +++ b/src/Form/ConfigForm.php @@ -82,6 +82,7 @@ public function init() 'value_options' => [ 'untitled' => '[Untitled]', // @translate 'no_text' => 'No text', // @translate + 'filename' => 'Filename', // @translate ], ], 'attributes' => [ diff --git a/view/octopus-viewer/site/viewer/media-selector.phtml b/view/octopus-viewer/site/viewer/media-selector.phtml index 14fd975..b1c008c 100644 --- a/view/octopus-viewer/site/viewer/media-selector.phtml +++ b/view/octopus-viewer/site/viewer/media-selector.phtml @@ -14,7 +14,8 @@ if ($defaultMediaTitle === 'no_text') { displayTitle(''); - $title = $displayTitle !== '' && $displayTitle !== $media->source() ? $displayTitle : $defaultTitle; + $defaultTitleForThisEntry = $defaultMediaTitle === 'filename' ? ($media->source() ?? '') : $defaultTitle; + $title = $displayTitle !== '' && $displayTitle !== $media->source() ? $displayTitle : $defaultTitleForThisEntry; ?>