News:

Join the Facebook Fan Page.

Main Menu

hide a element

Started by 33x, June 25, 2019, 06:57:46 PM

Previous topic - Next topic

33x

Hi guys i added a element  to the index.template.php and i need it to only show on the home page its showing on every page how to fix this

aryansindy

Hi, you can add the element as frontpage blog not in index.themplate.php  ,it  will show only in Frontpage(Home).
your site URL?

Sir Osis of Liver



if (($context['current_action'] == '') && ($context['current_board'] == ''))
{

echo '

<div class="your_element">

</div>';
}


Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Gary

This would probably be better from the above code:


if (empty($context['current_action']) && empty($context['current_board']) && empty($context['current_topic']))
{
//
}


Not tested it though.



There's also the option, depending on the location of the element, that placing it in BoardIndex.template.php might also be a solution.
Gary M. Gadsdon
Do NOT PM me unless I say so
War of the Simpsons
Bongo Comics Fan Forum
Youtube Let's Plays

^ YT is changing monetisation policy, help reach 1000 sub threshold.

Advertisement: