Hello,
Anyone know how I can display the Name (also called Title) of an image in the theImageAndInfos page (the page that shows one photo - it displays when you click a thumbnail.)
Configuration -Display has toggles for several properties. But it does not control the display of "Title" - which can be set in Manage Photo
System Info:
Piwigo 11.2.0
Operating system: Linux
PHP: 7.3.23 (Show info) [2021-02-04 16:00:05]
MySQL: 5.7.32 [2021-02-04 16:00:05]
Graphics Library: External ImageMagick 6.9.10-68
Site URL with image opened: http://www.gallery.corkcameragroup.net/ … category/6
It shows Author and the name of the original file - such as " _5220566-DXOGalTest.jpg" But I want its Title, which will be a more descriptive name e.g. "Dandelion by the coast"
Offline
Hello,
you can edit your template and get the title variable in the image porperties list.
For instance with default theme, I suggest editing (piwigo)/themes/default/template/picture.tpl,
and then going to line 172...
<dl id="standard" class="imageInfoTable"> {strip} {if $display_info.author and isset($INFO_AUTHOR)} <div id="Author" class="imageInfo"> <dt>{'Author'|@translate}</dt> <dd>{$INFO_AUTHOR}</dd> </div> {/if}
... in order to insert a div block for title display.
<dl id="standard" class="imageInfoTable"> {strip} {if isset($current.TITLE)} <div id="Title" class="imageInfo"> <dt>{'Title'|@translate}</dt> <dd>{$current.TITLE}</dd> </div> {/if} {if $display_info.author and isset($INFO_AUTHOR)} <div id="Author" class="imageInfo"> <dt>{'Author'|@translate}</dt> <dd>{$INFO_AUTHOR}</dd> </div> {/if}
In the future, one can imagine this to be made part of Piwigo "out of the box".
Offline
Beware, my suggestion is not compatible with Manage Properties Photos extension: https://piwigo.org/ext/extension_view.php?eid=783
Modifying code is not a so good idea, it can breaks things relying on previous state, like extensions. It's better to provide an extension, or improve existing ones.
Offline
Thank you so much for your suggestions @TOnin
I really appreciate you including the bit of code, since my PHP is not great! I will try to adjust my site to match.
Offline
Please, have a look at Manage Properties Photos plugin https://piwigo.org/ext/extension_view.php?eid=783
You will be able to create fields according to your wishes.
Offline