SimplePortal

Customization => Custom Coding => Topic started by: kai920 on August 18, 2009, 08:35:21 AM

Title: Block positions?
Post by: kai920 on August 18, 2009, 08:35:21 AM
Is it possible to add in new block positions? ie. in addition to top, bottom, left, and right?
Title: Re: Block positions?
Post by: [SiNaN] on August 18, 2009, 08:38:09 AM
Of course. But you'll need to make a lot of modifications.
Title: Re: Block positions?
Post by: kai920 on August 18, 2009, 08:45:41 AM
"A lot" means database modifications? What else is required?  (I'm only familiar with Joomla's method of loading "module positions")

If I don't "add" block positions to SP, which file(s) should I look at in order to "hardcode" PHP/HTML so that it can show up:

a) in portal frontpage
b) in forum's index
c) both (a) and (b)?

Would the files be in the default template?

Thanks!
Title: Re: Block positions?
Post by: [SiNaN] on August 18, 2009, 08:49:42 AM
"A lot" means database modifications? What else is required?  (I'm only familiar with Joomla's method of loading "module positions")

Not database changes. Many modification in source files. If you can achieve that successfully, you could become an SP Developer. ;)

If I don't "add" block positions to SP, which file(s) should I look at in order to "hardcode" PHP/HTML so that it can show up:

a) in portal frontpage
b) in forum's index
c) both (a) and (b)?

a) Portal.template.php
b) BoardIndex.template.php
c) index.template.php

Would the files be in the default template?

Yes.
Title: Re: Block positions?
Post by: kai920 on August 18, 2009, 11:34:41 AM
Not database changes. Many modification in source files. If you can achieve that successfully, you could become an SP Developer. ;)

While I might be able to hack the source files to add in more module positions... I don't think it would be wise for me to do so as each new release of SP will nullify the changes. Well, unless, I was a SP developer ;)

I'll wait for next versions of SMF and SP and see what I should do.

I'm probably just wanting to put more code on the portal homepage.
Title: Re: Block positions?
Post by: Eliana Tamerin on August 18, 2009, 11:44:42 AM
Where, though, would you want the new block positions? Perhaps its something you can achieve already or through some minor coding.
Title: Re: Block positions?
Post by: kai920 on August 18, 2009, 11:35:38 PM
Not sure yet. Maybe 2 positions side-by-side (ie 2 columns) above the "top" position;

or a position that spans the width of the forum above L, top, and R.
Title: Re: Block positions?
Post by: kai920 on August 21, 2009, 01:29:00 AM
Just had another idea... put L and R next to each other, and the mainbody (forum) off to one side.

Sort of like this (http://www.joystiq.com/2009/08/18/sony-announces-new-slimmer-ps3-coming-first-week-of-sept/).
Title: Re: Block positions?
Post by: Nathaniel on August 21, 2009, 01:43:04 AM
Just had another idea... put L and R next to each other, and the mainbody (forum) off to one side.

Sort of like this (http://www.joystiq.com/2009/08/18/sony-announces-new-slimmer-ps3-coming-first-week-of-sept/).

That would be incredibly easy to do, because it doesn't involve adding new sides. (I can show you how if you want.)
Title: Re: Block positions?
Post by: kai920 on August 21, 2009, 03:23:23 AM
Just had another idea... put L and R next to each other, and the mainbody (forum) off to one side.

Sort of like this (http://www.joystiq.com/2009/08/18/sony-announces-new-slimmer-ps3-coming-first-week-of-sept/).

That would be incredibly easy to do, because it doesn't involve adding new sides. (I can show you how if you want.)

I wouldn't mind seeing the solution just for reference... probably not going to make any mods to my forum until RC2 comes out though ;)

Would it just be 2 straight columns side by side, or could we include some modules that span both columns? (refer to the joystiq link I posted)
Title: Re: Block positions?
Post by: Eliana Tamerin on August 21, 2009, 11:56:23 AM
The joystiq page is more of a module that has two columns in itself, as the rest of the blocks span the width of those two top ones. So really, it's only using the right side blocks, in SP terms.

You could do something similar using php/html to make a table to divide it into two columns, and then insert your block code.
Title: Re: Block positions?
Post by: kai920 on September 05, 2009, 01:40:43 AM
Nathaniel, how would I go about moving the left column to the right so that 2 columns are side by side?
Title: Re: Block positions?
Post by: Nathaniel on September 05, 2009, 03:39:29 AM
These edits are for SP 2.3 and SMF 2 RC1.2.

File: '/Themes/default/Portal.template.php':
Code: ("Cut this code") [Select]
if (!empty($modSettings['showright']) && !empty($context['SPortal']['blocks'][4]))
{
echo '
<td id="sp_right"', !empty($modSettings['rightwidth']) ? ' width="' . $modSettings['rightwidth'] . '"' : '', $context['SPortal']['sides'][4]['collapsed'] && empty($modSettings['sp_disable_side_collapse']) ? ' style="display: none;"' : '', '>';

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

echo '
</td>';
}

Code: ("Paste the last code block, just before the code below") [Select]
echo '
<td id="sp_center">';

That will show both the left + right columns on the left side of your forum.
Title: Re: Block positions?
Post by: kai920 on September 06, 2009, 11:16:24 AM
Cool, thanks. I'll probably want to move both columns to the right side but with your tips that should be easily doable.

I was also thinking I could have just one wider right column and have dual blocks like Eliana described...  I wonder if it'd be easy to create a "split block" that lets you choose from available block types, instead of manually copy/pasting PHP code.
Title: Re: Block positions?
Post by: N-Joy on September 29, 2009, 09:06:29 AM
Cool, thanks. I'll probably want to move both columns to the right side but with your tips that should be easily doable.

I was also thinking I could have just one wider right column and have dual blocks like Eliana described...  I wonder if it'd be easy to create a "split block" that lets you choose from available block types, instead of manually copy/pasting PHP code.
How?
Title: Re: Block positions?
Post by: Nathaniel on September 29, 2009, 09:20:04 AM
Read my last post in this topic...

Moving them to the other side is similar.
Title: Re: Block positions?
Post by: N-Joy on September 29, 2009, 09:26:54 AM
Read my last post in this topic...

Moving them to the other side is similar.
But whenever I try to move the "leftwidth" code above the "sp_center" code, I still have a column on the right side, and one on the left side.. :s
Title: Re: Block positions?
Post by: Nathaniel on September 29, 2009, 08:02:31 PM
I said 'similar', not identical. ;)

Cut this code:
Code: [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>';
}

Put it above this code:
Code: [Select]
if (!empty($modSettings['showright']) && !empty($context['SPortal']['blocks'][4]))
SimplePortal 2.3.8 © 2008-2024, SimplePortal