Jump to content


[Hack]Create different block template for center block


  • You cannot reply to this topic
No replies to this topic

#1 visiblesoul

  • Administrators
  • 551 posts
  • Location:Earth
  • Texas

Posted 31 May 2006 - 11:01 AM

How to create a different block template for the center block
for Mkportal M1.1 Rc1
by visiblesoul

This hack will allow you to use 2 different block templates. The default block template will be used for the left and right columns and a new custom template will be used for the center column.

FIND in /mkportal/templates/default/tpl_main.php

function row_link( $icon, $url, $text) {
ADD ABOVE:
function view_block_center($title, $content) {
global $mklib;
return <<<EOF

<!-- begin center block template -->

			<tr>
			  <td class="tablemenu" valign="top">
			<table border="0" width="100%" cellpadding="0" cellspacing="0">
   			  <tr>
		 			<td>
						<table border="0" cellpadding="4" cellspacing="0" width="100%">
					  <tr>
				  <td width="100%" class="mktxtcontr" valign="middle" nowrap="nowrap">{$title}</td>
		 			</tr>
		 			  </table>
		 			</td>
			  </tr>
			  <tr>
		 			<td width="100%">
		 		  <table border="0" width="100%" cellpadding="0" cellspacing="1">
		 		  {$content}
			 		  </table>
				  </td>
			  </tr>
			</table>
			  </td>
			</tr>
			<tr>
			  <td class="tdspacer"> </td>
			</tr>

<!-- end center block template -->
  
EOF;
}
Modify this new center block template any way you want.


FIND in /mkportal/include/functions.php:
					if ($content != "") {
						$column .= $Skin->view_block($titlem, $content);
					}
REPLACE WITH:
					if ($content != "") {
				
				if ($position == "centro") {
				$column .= $Skin->view_block_center($titlem, $content);

				}
				else {
					$column .= $Skin->view_block($titlem, $content);
				}

					}



Please note that I offer free support on this forum in my free time. Depending on how much work I have backlogged it may take me a week or more to answer questions. I am not ignoring you. I answer everyone but please be patient. Thanks.

Disclaimer: All forum posts, including code examples, on this forum are offered for free in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Use code examples at your own risk.

"If at first you don't succeed, keep on suckin' til you do succeed." -Curly Howard





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users