Closed cweiske closed 7 months ago
Thanks for the feedback and a big sorry for the (very!) delayed response.
You are right, the current templating mechanism might be a little confusing when starting with this extension. The non standard behavior is a left over of the pre Extbase / Fluid era of this extension and the fact it's needed to somehow configure the template file per gallery type.
Extbase / Fluid only allows to configure one template path which is added to the controller and action name in order to determine the full file path to the template. For this extension we have another aspect: it allows to have different gallery types with (obviously) different templates. So controller and action for determining the last folder and file name is not sufficient.
I think configuring the whole file path (template = EXT:my_ext/Resources/Private/Templates/SomeFolder/SomeFile.html
) is more convenient than using a variable like templateName = SomeFile
or something similar. What do you think?
I do see that the docs need an update to better reflect on this behavior. Probably the default gallery type should have no template
and templateItem
TS settings set, so one can override the template as you tried to do.
I've added a PR with some proposed changes and would love to hear your feedback! Please see here: https://github.com/fnagel/generic-gallery/pull/56
Configuring the whole file path is better indeed.
Thanks for the feedback! PR has been merged :-)
I tried to use the gallery extension as base for my own gallery, only wanting to adjust the template file by overriding it in my provider extension.
So I installed generic_gallery 4.3.0, included the default typoscript template and set the constant to override the template directory:
Then I created
myext/Resources/Private/Templates/GalleryCollection/Show.html
and .. it did not get loaded. (IMO this is the standard way of overriding templates in nearly all typo3 extensions).To debug the issue, I removed generic_gallery's
Show.html
and now got an exception:I confirmed multiple times that
/var/www/typo3/public/typo3conf/ext/myext/Resources/Private/Templates/GalleryCollection/Show.html
actually exists, which it did.In the end I found that
generic_gallery/Configuration/TypoScript/setup.typoscript
includesEXT:generic_gallery/Configuration/TypoScript/Examples/setup.typoscript
, which sets.. which overrides the template path configured earlier.
This is very confusing.
I suggest not loading the example typoscript with the standard generic_gallery typoscript (instead adding an example typoscript record that can be selected in the typoscript template setup), and adding a section about templating in the manual.