Page 1 of 1

KB Archiv EN: Board3 Portal 1.0.x - Features

Posted: 21. January 2017 17:16
by Kevin
Board3 Portal 1.0.x - Features: Adding Custom Blocks

This guidance is written for B3P v1.0.5 and higher and will not work for previous versions!

First of, make a new file (your Block) in \styles\your_style\template\portal\block\ and call it i.e. new_block.html
Now you have to decide if this Block will be a center block or if it will be in left or right column.
Last but not least you should know, if your Style is based on prosilver or subsilver2.

Here are the possible combinations: (paste the matching code to your new file)

left/ right Block for prosilver:

Code: Select all

{$LR_BLOCK_H_L}Your_Block_Title{$LR_BLOCK_H_R}
             <div style="text-align: center;">
         
  ... Place your Code here ...
          
 </div>
{$LR_BLOCK_F_L}{$LR_BLOCK_F_R}
center Block for prosilver:

Code: Select all

{$C_BLOCK_H_L}<dt>Your_Block_Title</dt>{$C_BLOCK_H_R}
	<ul class="topiclist forums">
		<li><dl>
			<dd style="border-left: 0px">
			
 ... Place your Code here ...
		
	</dd>
		</dl></li>
	</ul>
{$C_BLOCK_F_L}{$C_BLOCK_F_R}
left/ right Block for subsilver2:

Code: Select all

{$LR_BLOCK_H_L}Your_Block_Title{$LR_BLOCK_H_R}
<table class="tablebg" cellspacing="1" width="100%">
	<tr class="row1">
		<td style="text-align:center;">

 ... Place your Code here ...
			
		</td>
	</tr>
</table>
{$LR_BLOCK_F_L}{$LR_BLOCK_F_R}
center Block for subsilver2:

Code: Select all

{$C_BLOCK_H_L}Your_Block_Title{$C_BLOCK_H_R}
<table class="tablebg" cellspacing="1" width="100%">
	<tr class="row1">
		<td>

 ... Place your Code here ...

		</td>
	</tr>
</table>
{$C_BLOCK_F_L}{$C_BLOCK_F_R}



Now you have to include the Block in your Portal. But there are two possible ways to do it: the new one, and the old one. ;)
Both methods will let you keep your new block after an update. The new method will let you decide where to put your block, the old method will just add your block at a specific position, which is determined by the additional_blocks files. The new method gives you more flexibility, so we recommend you use the new method.


The new method:
Decide where you want to put your block. Depending on that, open styles/*yourstyle*/template/portal/ portal_left.html, portal_center.html or portal_right.html.
In those files, each block is inside an if-statement, i.e. the mainmenu looks like this:

Code: Select all

<!-- IF S_DISPLAY_MAINMENU -->
	<!-- INCLUDE portal/block/main_menu.html -->
<!-- ENDIF -->
If you know where you want to put your block, just put it before or after an if-statement of the other blocks. For example, your new_block.html would be included like this:

Code: Select all

<!-- INCLUDE portal/block/new_block.html -->
You don't need the if-statements, as this is just for the ACP management of the original Board3 blocks.
After you are done, save the file as UTF8 without BOM and make sure to refresh the template cache of your style.


The old method:

open styles\your_style\template\portal\block\additional_blocks_right.html (or additional_blocks_left... / ...center.html)

search for:

Code: Select all

<!-- additional_blocks //-->
add after:

Code: Select all

<!-- INCLUDE portal/block/new_block.html -->

OK, thats it. Dont forget to purge the cache after you add a Block.
Further information about how to move Blocks position: Knowledge Base: Moving blocks / change order


Adding PHP Code for your block
If you need to execute PHP code for your new block, there is an easy way to do this. Adding PHP Code to the block file will not do anything at all. Open portal/block/additional_blocks.php and add your PHP right in front of this:

Code: Select all

?>
Make sure you leave no spaces before <?php and after ?> and save the file as UTF8 without BOM.


Here you can discuss this Article: http://board3.de/viewtopic.php?f=21&t=310

Quicklink:

Code: Select all

[url=http://www.board3.de/knowledge/kb_show.php?id=51]Knowledge Base: Adding Custom Blocks[/url]

Board3 Portal 1.0.x - Features: How to avoid invisible credi

Posted: 21. January 2017 17:18
by Kevin
Board3 Portal 1.0.x - Features: How to avoid invisible credits

In several styles like "se_pro" or "ProNight" the Portal credits are invisible by default.
To solve this, simply open your /styles/*your_style*/template/portal/portal_body.html

search for:

Code: Select all

<div class="copyright" align="center">{L_PORTAL_COPY}</div>
and replace with

Code: Select all

<div style="color:black; text-align: center">{L_PORTAL_COPY}</div>
Thanks a lot for making our credits visible again!

Quicklink:

Code: Select all

[url=http://www.board3.de/knowledge/kb_show.php?id=47]Knowledge Base: How to avoid Invisible Credits[/url]