I have a website running under Joomla 3.10.11, which displays various banner modules on all post category pages.
The goal is to NOT show any banner when the user enters the article page. Is it possible without changing any layouts?
Easy ways css ways
Put banner class like .showbanner-oncat Then in menu category add css
.showbanner-oncat{display:block}
in menu default handle article add css
.showbanner-oncat{display:none}
custom ways
Override the mod banner view Then do
if ($context === 'com_content.article'}{
$wa->addCssDeclaration('.showbanner-oncat{display:none}');
}
else{
$wa->addCssDeclaration('.showbanner-oncat{display:block}');
}
But these are still impact the peformance, maybe a little ms and the banner js still load if display none set up.
joomla ways
You can make config association menu to display the module only on some menu
You are full control
You need do custom model to cut the peformance loss
if ($context === 'com.content.category`){
do dbo and pass the view.
}
else {return}