• Welcome to Simple Machines Community Forum. Please login or sign up.
October 20, 2021, 06:16:05 AM

News:

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


Redirect boards on mobile - div.lastpost better hidden.

Started by Antechinus, August 28, 2021, 09:13:26 PM

Previous topic - Next topic

Antechinus

August 28, 2021, 09:13:26 PM Last Edit: October 14, 2021, 08:18:15 PM by Diego Andrés
This is not such an issue with only one redirect per category, but could become annoying with a category devoted to redirects.

Even on mobile, the .lastpost div is currently visible all the time. Obviously it has no content with a redirect board, so is a waste of space. It could be targeted by custom css and media queries, like this:

@media screen and (max-width: 480px) {#board_146 .lastpost {display: none;}}
But that's a bit of a nuisance to set up, and should not be necessary. If BoardIndex.template.php and MessageIndex.template.php are changed to append the board type as an additional class to class="up_contain", like this:
foreach ($category['boards'] as $board)
{
echo '
<div id="board_', $board['id'], '" class="up_contain ', $board['type'],' ', (!empty($board['css_class']) ? $board['css_class'] : ''), '">

...then responsive.css can just be like this:
/* We have shared things... */
@media screen and (max-width: 720px) {

/* BoardIndex */
.board_stats, .redirect .lastpost {
display: none;
}

}

Which takes care of all cases for everyone. No muss, no fuss. And would also allow extra styling opportunities for the board index if any nutter ever wanted them. :)

Advertisement: