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

From aMember Pro Documentation
Jump to: navigation, search
 
(3 intermediate revisions by one user not shown)
Line 3: Line 3:
 
//add new block at position member/main/left
 
//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, function (Am_View $v) {
 
Am_Di::getInstance()->blocks->add(new Am_Block('member/main/left', 'My Block Title', 'my-block-id', null, function (Am_View $v) {
     $html = <<<CUT
+
     return <<<CUT
 
     <p>You can put some html code here</p>
 
     <p>You can put some html code here</p>
 
CUT;
 
CUT;
    return $html;
+
}));
});
+
  
//remove block with id member-main-unsubscribe (Unsubscribe from all email messages block)
+
//Remove Active Subscriptions block
Am_Di::getInstance()->blocks->remove('member-main-unsubscribe');
+
Am_Di::getInstance()->blocks->remove('member-main-subscriptions');
  
 +
//Remove Active Resources block
 +
Am_Di::getInstance()->blocks->remove('member-main-resources');
  
// Remove newsletter subscriptions  blog:  
+
//Remove Useful Links block
 +
Am_Di::getInstance()->blocks->remove('member-main-links');
 +
 
 +
// Remove Newsletter Subscriptions blog:  
 
Am_Di::getInstance()->blocks->remove('member-main-newsletter');
 
Am_Di::getInstance()->blocks->remove('member-main-newsletter');
  
 +
//Remove Unsubscribe from all email messages block
 +
Am_Di::getInstance()->blocks->remove('member-main-unsubscribe');
  
 
</source>
 
</source>

Latest revision as of 09:26, 21 April 2017

Add this code to site.php file:

//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, function (Am_View $v) {
    return <<<CUT
     <p>You can put some html code here</p>
CUT;
}));
 
//Remove Active Subscriptions block
Am_Di::getInstance()->blocks->remove('member-main-subscriptions');
 
//Remove Active Resources block
Am_Di::getInstance()->blocks->remove('member-main-resources');
 
//Remove Useful Links block
Am_Di::getInstance()->blocks->remove('member-main-links');
 
// Remove Newsletter Subscriptions blog: 
Am_Di::getInstance()->blocks->remove('member-main-newsletter');
 
//Remove Unsubscribe from all email messages block
Am_Di::getInstance()->blocks->remove('member-main-unsubscribe');