Metadata.php - choose block depending on theme

hi,
If it is possible to create the same block name extend with different folder structure based on the theme folder. Can anyone please provide a solution for these cases.
For example.
‘blocks’ => [
[ ‘template’ => ‘page/checkout/payment.tpl’,
‘block’ => ‘select_payment’,
‘file’ => ‘/views/blocks/azure/page/checkout/examplepayments.tpl’
],
[ ‘template’ => ‘page/checkout/payment.tpl’’,
‘block’ => ‘select_payment’,
‘file’ => ‘/views/blocks/flow/page/checkout/examplepayments.tpl’
],
[ ‘template’ => ‘page/checkout/payment.tpl’’,
‘block’ => ‘select_payment’,
‘file’ => ‘/views/blocks/wave/page/checkout/examplepayments.tpl’
], ]

I do not think so, but you could do it like this (in the block):
[{assign var=“oTheme” value=“oxTheme”|@oxNew}]
[{if $oTheme->getActiveThemeId() == “theme1”}]
Code theme1
[{elseif …}]
Code theme 2
[{/if}]

Oh sorry…see next…

Hi,
from oxid 6.1 (metadata 2.1) you can specify the theme-id in the block description:

'blocks' => [
    [
        'theme' => 'shop_theme_id'
        'template' => 'name_off_shop_template_which_contains_block',
        'block'=>'name_off_shop_block',
        'file'=>'path_to_module_block_file'
    ]
]

Source: https://docs.oxid-esales.com/developer/en/6.1/modules/skeleton/metadataphp/version21.html

Thank you :slight_smile: