SimplePortal

Customization => Custom Coding => Topic started by: Titanium13 on January 20, 2014, 04:50:44 PM

Title: Move Portal left blocks to the left of the page (image included)
Post by: Titanium13 on January 20, 2014, 04:50:44 PM
Hello!,
Well I trying to move the left portal blocks all to the left of the page, in a way they can ocupy the forum from the header till the bottom. To do this I made a new div aligned to the left of the page and tried to put some code from sp_left but it couldn't put it working, so i just called the template_above_portal() function like this:
Code: [Select]
<div id="sidebar" style="background-color: #2a2a2a; width: 220px; height:1000px float: left;">
<div >
', template_portal_above(), '
     </div>
<div id="wrapper">
<div id="header">
(...)

well it was placed where I wanted it but now I have the block in two places: where I wanted and where they are originally (aligned to the left of forum body). I tried to work out how to removed that and maintain my "left sidebar" but I couldn't manage to do it.

(http://imagizer.imageshack.us/v2/1024x768q90/809/u8zp.png) (https://imageshack.com/i/mhu8zpp)

Basically what I want is to maint the thing that is in the blue box and erased the one in the green box.


Thanks in advance!

Cumps,
Titanium13
Title: Re: Move Portal left blocks to the left of the page (image included)
Post by: [SiNaN] on January 24, 2014, 03:55:15 PM
Hello and welcome to SimplePortal!

What you need to do is, remove the following code:

Themes/default/Portal.template.php

Code: (Find) [Select]
if (!empty($modSettings['showleft']) && !empty($context['SPortal']['blocks'][1]))
{
echo '
<td id="sp_left"', !empty($modSettings['leftwidth']) ? ' width="' . $modSettings['leftwidth'] . '"' : '', $context['SPortal']['sides'][1]['collapsed'] && empty($modSettings['sp_disable_side_collapse']) ? ' style="display: none;"' : '', '>';

foreach ($context['SPortal']['blocks'][1] as $block)
template_block($block);

echo '
</td>';
}

Then for the part of the code you've provided, do the following:

Code: (Find) [Select]
<div >
', template_portal_above(), '
     </div>

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

foreach ($context['SPortal']['blocks'][1] as $block)
template_block($block);

echo '
</div>
Title: Re: Move Portal left blocks to the left of the page (image included)
Post by: Titanium13 on January 25, 2014, 10:13:32 PM
Thank you! It worked well :)
Title: Re: Move Portal left blocks to the left of the page (image included)
Post by: [SiNaN] on January 26, 2014, 03:24:20 PM
You're welcome. ;)
SimplePortal 2.3.8 © 2008-2024, SimplePortal