News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Show only on board index

Started by tyra, September 19, 2015, 02:50:26 AM

Previous topic - Next topic

tyra

Hello!

I wnt to put text "Sample text" to board header right next to logo. Text should be visible only if user or visitor is on the board index. How can i do this. I see forum "info center" is acting just like i need but i don't find the code what makes it to act like this (visible only on board index).

Can you please help me out a bit ?

Kindred

well, the info center is part of the boardindex.template.php file -- which only displays on the board index page.

unfortunately, the HEADER is part of the index.template.php file -- which displays on every page

You would have to ADD conditional code

(also - you should upgrade to 2.0.11 since 1.1.x is coming o the end of life, shortly.)
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

tyra

Thakns for reply, but what conditon does info center use to it's apparance only on board index?

Kindred

it does not use ANY conditional.

boardindex.template.php is ONLY - EVER - shown on the boardindex.
Just like Display.template.php is only EVER shown on the message thread view.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Sir Osis of Liver




/// Show header text on board index only

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

echo ' Your text here.';



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

                                     - R. Waters

tyra

Thanks Sir Osis of Liver! Works fine.

Advertisement: