News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Text on top of boardindex.template.php

Started by bobi, March 14, 2012, 10:51:38 AM

Previous topic - Next topic

bobi

Into mytheme/Boardindex.template.php,

I try to add echo '<BLOCKQUOTE><BLOCKQUOTE><p>ethnobotanique / ?t.no.b?.ta.nik<br>(Ethnologie) (Botanique) Qui concerne l\'&eacute;tude des relations entre les peuples et les plantes.</p></BLOCKQUOTE></BLOCKQUOTE>';


So the text appear on the very top of the board index. It works but it also break the layout (the text of the sections become large, etc).

How can I add this text witout affecting the layout?

IchBin™

Does this happen in all themes? Or just a particular theme? Not much we can do if you don't show us the problem. Helps if you post a link so others can see what you are talking about.

Why does your code have a double blockquote tags? Text should be lower case as well.
IchBin™        TinyPortal

bobi

It happen with Core theme. I use the blockquotes to align the text with the layout.
At left the normal layout, at right the broken.

IchBin™

You need to put your code inside the container div. Basically the first div after the <body> tag.

To do what you need, you don't need to use the blockquote tag. A simple paragraph tag would be fine.
IchBin™        TinyPortal

bobi

BoardIndex starts like this:

<?php
/**
 * Simple Machines Forum (SMF)
 *
 * @package SMF
 * @author Simple Machines
 * @copyright 2011 Simple Machines
 * @license http://www.simplemachines.org/about/smf/license.php BSD
 *
 * @version 2.0
 */

function template_main()


I placed the echo just before the first function. If I place it after the function, the text is moved under Accueil - Aide - Rechercher - ...
I already tried to place the text between <div></div> but the same problem happens.
Do I need to set a particular parameter to <p>, so it will replace the blockquotes?

bobi

#5
I'm sorry, am I missing something? Did you mean I should add the code like this? :

Quote<body>
<div><p>ethnobotanique / zt.no.bz.ta.nik<br>(Ethnologie) (Botanique) Qui concerne l\'&eacute;tude des relations entre les peuples et les plantes.</p></div>
</body>
<?php
...

(it doesn't work either)

IchBin™

Yes, all text that appears on the page MUST be after the <body> tag in the index.template.php file. Otherwise you can have bad side-affects that cause different problems in your forum layout and stuff.

(it doesn't work either) does not tell me what the problem is. Post a link or another screenshot. In addition, please post the code you have so we can see how you are doing it.
IchBin™        TinyPortal

bobi

I wrote this code into index.template.php;

<body>';
}

function template_body_above()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;

echo '
<div id="mainframe"', !empty($settings['forum_width']) ? ' style="width: ' . $settings['forum_width'] . '"' : '', '>
[b]<p>ethnobotanique / et.no.bo.ta.nik<br>(Ethnologie) (Botanique) Relations entre les peuples et les plantes.</p>[/b]


It work, but how can I set a condition so it only appear on the board index page? Thank you.

bobi

Anyone? I feel this is easy but I'm just not used to this

IchBin™

Maybe a check like this might work.

if (!isset($context['current_board']))
    echo your code.

By the way, you can't use BBC code in the page like that for the bold part. You need to use HTML.
IchBin™        TinyPortal

bobi

It doesn't work, the echo is triggered on every pages

if (!isset($context['current_board'])) {
echo 'test';
}


I also tried echo $context['current_board']; but it return no value.

bobi

I used:

if (empty($context['current_board']) && empty($context['current_action']))
{
echo 'test';
}


Thank you.

Advertisement: