Difference between revisions of "How to add/remove html blocks in member's area"

From aMember Pro Documentation
Jump to: navigation, search
Line 1: Line 1:
Create /amember/application/configs/site.php with this code:  
+
Add this code to [[site.php file]]:
 
+
 
<source>
 
<source>
 
<?php
 
<?php

Revision as of 03:33, 9 August 2013

Add this code to site.php file:

<?php
//add new block at position member/main/left
Am_Di::getInstance()->blocks->add(new Am_Block('member/main/left', 'My Block Title', 'my-block-id', null, 'renderMyBlock'));
 
function renderMyBlock() {
    $html = <<<CUT
     <p>You can put some html code here</p>
CUT;
    return $html;
}
 
//remove block with id member-main-unsubscribe
Am_Di::getInstance()->blocks->remove('member-main-unsubscribe');