SimplePortal

Support => English Support => Topic started by: fapencio on December 05, 2014, 05:42:11 PM

Title: Board News in 2 columns
Post by: fapencio on December 05, 2014, 05:42:11 PM
Hi friends, I need your help, I would like to split into 2 columns the "BOARD NEWS" block, like this:

(http://i59.servimg.com/u/f59/18/92/31/95/portal10.jpg)

(http://i59.servimg.com/u/f59/18/92/31/95/portal11.jpg)

thanks in advance
Title: Re: Board News in 2 columns
Post by: [SiNaN] on December 07, 2014, 10:21:35 AM
Sources/PortalBlocks.php

Code: (Find) [Select]
else
{
foreach ($return as $news)
{
echo '
<div class="sp_article_content">';

Code: (Replace) [Select]
else
{
$count = count($return);
foreach ($return as $key => $news)
{
$last = $key == $count - 1;
$even = $key % 2 == 0;

if ($even)
echo '
<div style="overflow: auto;">';
echo '
<div style="float: ', $even ? 'left' : 'right', '; width: 49%;">';

echo '
<div class="sp_article_content">';

Code: (Find) [Select]
echo '
</div>';
}
}

if (!empty($per_page))

Code: (Replace) [Select]
echo '
</div>';

echo '
</div>';
if (!$even || $last)
echo '
</div>';
}
}

if (!empty($per_page))

You may have to do some fine-tuning if your content size is too dynamic though.
Title: Re: Board News in 2 columns
Post by: fapencio on December 07, 2014, 12:28:50 PM
Thanks Master Sinan, It worked perfectly, just the white line separating the two columns is a bit wide, no way to reduce it? please?  check my portal forum
Title: Re: Board News in 2 columns
Post by: [SiNaN] on December 07, 2014, 12:36:10 PM
You just need to increase 49% to something bigger but less than 50% in the first change. (like 49.5%) Just try yourself and see what works out best for you.
Title: Re: Board News in 2 columns
Post by: fapencio on December 07, 2014, 02:23:58 PM
awesome, thanks my friend, i change to 49.7%, this tutorial will serve many users, Greetings, TOPIC SOLVED
Title: Re: Board News in 2 columns
Post by: [SiNaN] on December 07, 2014, 02:33:46 PM
I hope it does. You're welcome. :)
SimplePortal 2.3.8 © 2008-2024, SimplePortal