Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Aiheen aloitti: samborabora - syyskuu 13, 2013, 10:29:36 AP

Otsikko: Child boards in same table as main boards?
Kirjoitti: samborabora - syyskuu 13, 2013, 10:29:36 AP
I'd love to replicate this idea of having child boards as a rollover in the same <td> as the main forum title? Kanyetothe forums do it, but I can't post the link unfortunatly. What is the easiest and least likely to break my forum way of implementing this?  Thanks!
Otsikko: Re: Child boards in same table as main boards?
Kirjoitti: Kindred - syyskuu 13, 2013, 10:50:32 AP
you would have to recode the boardindex template
Otsikko: Re: Child boards in same table as main boards?
Kirjoitti: samborabora - syyskuu 13, 2013, 12:12:05 IP
Okay, that's cool, I can do that. Can you suggest what I should start with, roughly, so I can get an idea of what part is best to change? I couldn't find a mod to do this, although it would be amazing if there was one. Thanks!
Otsikko: Re: Child boards in same table as main boards?
Kirjoitti: Kindred - syyskuu 13, 2013, 12:20:36 IP
there is no mod, which is why I said you would have ot do the recoding... :P

Moving to the coding board, since this is not actually a support question.
Otsikko: Re: Child boards in same table as main boards?
Kirjoitti: samborabora - syyskuu 13, 2013, 12:26:56 IP
Ahh, sorry about posting in the wrong forum! Anyways, if there's anyone here who could suggest the simplest way of performing this template change, I'd be most appreciative! Thanks!
Otsikko: Re: Child boards in same table as main boards?
Kirjoitti: margarett - syyskuu 13, 2013, 01:06:04 IP
The coding of BoardIndex is actually quite easy (depending on the theme, of course..)

The beginning of the code for a complete board is (default theme):

foreach ($category['boards'] as $board)
{
echo '
...

You will see that the code is full of comments. If you know HTML it should be pretty easy to accomplish it. Of course you need to use your friend firebug ;)
Otsikko: Re: Child boards in same table as main boards?
Kirjoitti: samborabora - syyskuu 14, 2013, 05:44:39 IP
Hi there, yes I know HTML very well, I just need a little guidance as to how I should start, really. I don't want to mess up any existing code, and it's not as simple when one has to compare the final served html with the template which is comprised of pre-served php code, even though it has html within it. Just a couple of suggestions would be handy, as it probably wouldn't take much more than a couple of shifts of code, and some css styling which would be really easy. Thanks!
Otsikko: Re: Child boards in same table as main boards?
Kirjoitti: samborabora - syyskuu 15, 2013, 05:23:35 IP
Okay, I've been studying the board template for ages trying to reorder it, and it seems so simple, yet every move I make seems to break it somehow! I have attached my board template, complete with any mods I have installed, and would appreciate it if anyone could reorder the code so that the child boards appear in the same cell as the main board title, I can take care of the rollover code myself, hopefully, with some simple css. Thanks in advance!
Otsikko: Re: Child boards in same table as main boards?
Kirjoitti: samborabora - syyskuu 15, 2013, 06:01:51 IP
Okay, as far as I can tell, THAT works, I just need to get the span class hover working in css, and we'll be all set, I do believe.
Otsikko: Re: Child boards in same table as main boards?
Kirjoitti: samborabora - syyskuu 20, 2013, 01:30:04 IP
I managed to do it with:

.childroll {
    display: none;
padding-left:10px;
}

tr.windowbg2:hover .childroll {
display:inline;
}


And wrapping the childboards with:

<span class="childroll">', implode(', ', $children), '</span>

After suitable readjustments of the positioning of the childboards.