Thank you for sharing these updates.
The structure of blocks is different in this content template, as compared to the one for the brand owners.
For this content template, you'll need to update the CSS code accordingly too:
<style>
.wp-block-columns .wp-block-column .tb-button.shop-online-button,
.wp-block-columns .wp-block-column .tb-button.optician-no-brands {
display:none;
}
</style>
[wpv-conditional if="( '[wpv-view name='related-optician-eyewear-brand-brand-ids']' ne '' )"]
<style>
.wp-block-columns .wp-block-column .tb-button.shop-online-button {
display:block !important;
}
</style>
[/wpv-conditional]
[wpv-conditional if="( '[wpv-view name='related-optician-eyewear-brand-brand-ids']' eq '' )"]
<style>
.wp-block-columns .wp-block-column .tb-button.optician-no-brands {
display:block !important;
}
</style>
[/wpv-conditional]
Note: To check which CSS code is applying to different page elements, you can use Google Chrome's inspect element tool, as explained in this guide:
versteckter Link
As for directly using the conditional block, it is possible but will require a custom shortcode as the view's shortcode output can't be used in a conditional block.
You'll first register a custom shortcode that will get the view's output and returns 1 if it is not empty and 0 otherwise.
Example:
add_shortcode('output_view_check_optician', 'output_view_check_optician_fn');
function output_view_check_optician_fn() {
$content = do_shortcode("[wpv-view name='related-optician-eyewear-brand-brand-ids']");
if(!empty(trim($content))) {
return '1';
}
else
{
return '0';
}
}
Next, please add "output_view_check_optician" in the "Third-party shortcode arguments" section, at WP Admin -> Toolset -> Settings -> Front-end Content.
After that, you can add two conditional blocks, one to show each button and then this new shortcode will be available in the list of conditional checks.
As for the button background colors, I tried to save the background settings and the issue with the header slider returned once the content template was saved.
Can you please share some details about how are you adding this slider, so that I can investigate this issue on my test website.
For now, you can fix the slider block again and use some custom CSS code, to apply black background to both buttons:
.wp-block-columns .wp-block-column .tb-button.shop-online-button a.tb-button__link,
.wp-block-columns .wp-block-column .tb-button.optician-no-brands a.tb-button__link {
background-color: rgba( 0, 0, 0, 1 );
}