Hey there.
I want to add something, for example banners on all pages under the header except on front page (board index). How can I do that? I need code to be added in Index.template.php but I'm not sure if there's something like 'if curenturl is not equal to boardindexurl" statement or something similar.
Thanks!
not certain... but I think this would work
if (empty($context['current_action']))
if (empty($context['current_action']) && empty($topic) && empty($board))
Just make sure everything is in scope before trying to check them.
Just tried this, but it's not working though.
if (empty($context['current_action']) && empty($topic) && empty($board))
{
echo'banner code here';
}
echo'
$context is already in globals, just checked that. Not sure what I'm doing wrong. :-X
Did you add topic and board to globals for that function?
And when you say 'not working', define 'not working', I can think of a multitude of different ways that 'not working' could play out depending on what you're doing, where and how.
Yes, topic and board are also in globals for that function, i just double-checked.
When I add the code that I wrote in previous message the banner is showing on boardIndex, and not showing on all other pages/boards/topics. What I need is vice versal - to show on all other pages and to hide it on board index.
EDIT: Gotcha, thanks!
I used:
if (empty($context['current_action']) && empty($topic) && empty($board))
{
echo'something that should be shown on board index';
}
else {
echo' banner HTML code here ';
}
Have you tried switching the instructions? The content on first echo switches with the content on else echo. ;)
Edit: ok, too late, I see you already got it. ;D