Where is the best place for tpl blocks in oxid6 modules?

module

#1

In the OXID6 paypal module you´ll find the tpl-blocks here:
/views/blocks/
In the OXID6 GDPR Opt-in module you´ll find the tpl-blocks here:
/Application/views/blocks/

In the metadata.php from the OXID6 paypal module, there is a starting slash in the file-section of a view-config-array.
‘file’=>’/views/blocks/deliveryset_main.tpl’
In the metadata.php from the OXID6 GDPR Opt-in module, there is NO starting slash in the file-section of a view-config-array.
‘file’ => ‘Application/views/blocks/user_invoice_address_form.tpl’,

both versions works fine. But what do thing is the better way?


#2

based on my experience with previous versions of oxid, the safest option would be an absolute path (with starting / )
with that, you can place block files where ever you want.

but keep in mind, when having an application folder in you module, shop will search only there for frontend translations


#3

Ahh, this is interesting with the /Application-Folder, the first slash and the translation-Folder.
I will orient myself on the GDPR Opt-in module.

Thanks!