SimplePortal
Customization => Blocks and Modifications => Block Requests => Topic started by: Mulwa on July 04, 2014, 05:56:39 AM
-
please is there anyway i can add blocks in simple portal blocks?
-
http://simpleportal.net/index.php?topic=5332.0 ??
-
Cleaned up the title a little bit again.
Has the topic linked above helped you with your question?
-
@Sinan, i didn't understand what's in that link post. I want four blocks in a single block (e.g. I would like to put: facebook link in one, twitter in one, subscribe in one, google plus in the other), what is in that link that was given above is just complicated and no newbie can easily do it, pls help me out
-
Here is a summary/copy
First
Create the blocks you want inside the main block (Facebook, Twitter etc).
You decide the type you need...php or html etc.
Do not set the blocks 'Active'.
Position does not matter as they are in another block.
Second
Get the ID numbers of the blocks you just created.
You can find them by looking at the link in the blocks list - the number will be at the end.
Third
Make the main block (the others will go inside). This is a custom php block and set active in the position you want.
Setting is for only 2 things:
$columns = x;
Decide how many columns across the page (4x1 or 2x2?). You will probably use 1 line of 4 blocks so set it to $columns = 4
$block_ids = array(a,b,c,d);
a,b,c,d will be your Facebook, Twitter,subscribe and Googleplus block ID's.
Copy this code inside the block (with your own block ID's and column setting)
$columns = 2;
$block_ids = array(49, 50, 52, 53);
$block_data = array();
foreach ($block_ids as $block)
{
$block_data[$block] = current(getBlockInfo(false, $block, false, false));
$block_data[$block]['style'] = sportal_parse_style('explode', $block_data[$block]['style'], true);
}
echo '
<table style="width: 100%;">
<tr>';
$counter = 0;
foreach ($block_data as $data)
{
if ($counter != 0 && $counter % $columns == 0)
{
echo '
</tr>
<tr>';
}
echo '
<td style="width: ', ceil((100 / $columns)), '%; vertical-align: top;">
', template_block($data), '
</td>';
$counter++;
}
echo '
</tr>
</table>';
-
you rock man! Am gonna try this out on my localhost, though am not sure whether it's gonna work on localhost. It's just clear and simple. Dumb up sir!
-
thanks @Andy.
I was unlucky that it couldn't work for Me, though am using localhost as for now before i'll make it live. I used html for those blocks that i'd like to be in the same block and made then inactive. And used the host block as php and it's shows errors in the block. I don't really know if it could work on localhost either.
Thanks for your support.
-
What do you mean by localhost?
-
localhost is a server that you can use in your system without the use of internet connection. Example, wampserver
-
Here is a summary/copy
First
Create the blocks you want inside the main block (Facebook, Twitter etc).
You decide the type you need...php or html etc.
Do not set the blocks 'Active'.
Position does not matter as they are in another block.
Second
Get the ID numbers of the blocks you just created.
You can find them by looking at the link in the blocks list - the number will be at the end.
Third
Make the main block (the others will go inside). This is a custom php block and set active in the position you want.
Setting is for only 2 things:
$columns = x;
Decide how many columns across the page (4x1 or 2x2?). You will probably use 1 line of 4 blocks so set it to $columns = 4
$block_ids = array(a,b,c,d);
a,b,c,d will be your Facebook, Twitter,subscribe and Googleplus block ID's.
Copy this code inside the block (with your own block ID's and column setting)
$columns = 2;
$block_ids = array(49, 50, 52, 53);
$block_data = array();
foreach ($block_ids as $block)
{
$block_data[$block] = current(getBlockInfo(false, $block, false, false));
$block_data[$block]['style'] = sportal_parse_style('explode', $block_data[$block]['style'], true);
}
echo '
<table style="width: 100%;">
<tr>';
$counter = 0;
foreach ($block_data as $data)
{
if ($counter != 0 && $counter % $columns == 0)
{
echo '
</tr>
<tr>';
}
echo '
<td style="width: ', ceil((100 / $columns)), '%; vertical-align: top;">
', template_block($data), '
</td>';
$counter++;
}
echo '
</tr>
</table>';
hi can the above be used like this page http:// daiwafishing .com.au/ where it has there news & make the blocks look like that?????
-
Yes, try it! ;)
-
all good working :)
-
Hi again how would i go about making the pictures move like they do on the page when hovering over them would that be java script as well?