Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted March 30, 20231 yr Hello, i'm trying to make something work on my localhost installation and after 2 hours of trying to add a block to ACP Member Profile, i'm coming here to ask for help. What i did: I've created an extension trough Developer Center I've tried to change default output from return 'Hello World!'; to template but neither of those two seem to be working. I've disabled DEV_MODE to check if that was the issue but even with dev_mode disabled, nothing showed. Is there something i'm missing?
March 30, 20231 yr 1 hour ago, CodePixel said: I've tried to change default output from return 'Hello World!'; to template but neither of those two seem to be working. Could you show us your code maybe?
March 30, 20231 yr Author 4 minutes ago, DawPi said: Could you show us your code maybe? It's basic extension code, didn't change anything.
March 30, 20231 yr You'll also need either a hook or a MemberACPProfileTabs extension to register the new block/tell the system where to show the block.
March 30, 20231 yr 16 minutes ago, Daniel F said: You'll also need either a hook or a MemberACPProfileTabs extension to register the new block. Btw, just a note: both extensions are missing in the docs: They appear in the overview but they don't have a page to themselves like the others.
March 31, 20231 yr Author 17 hours ago, Daniel F said: You'll also need either a hook or a MemberACPProfileTabs extension to register the new block/tell the system where to show the block. Can any info about this be found somewhere?
March 31, 20231 yr Solution 6 minutes ago, CodePixel said: Can any info about this be found somewhere? This is one example from one of my resources: class _Main extends \IPS\core\MemberACPProfile\MainTab { /** * Get left-column blocks * * @return array */ public function leftColumnBlocks() { return array( 'IPS\membernotes\extensions\core\MemberACPProfileBlocks\AccountData', ); } /** * Get main-column blocks * * @return array */ public function mainColumnBlocks() { return array( 'IPS\membernotes\extensions\core\MemberACPProfileBlocks\Notes', ); } /** * Get right-column blocks * * @return array */ public function rightColumnBlocks() { return array(); } /** * Get Output * * @return string */ public function output() { return parent::output(); } } Mobile phone. No way to use CODE tag.
March 31, 20231 yr Author 1 minute ago, Adriano Faria said: This is one example from one of my resources: class _Main extends \IPS\core\MemberACPProfile\MainTab { /** * Get left-column blocks * * @return array */ public function leftColumnBlocks() { return array( 'IPS\membernotes\extensions\core\MemberACPProfileBlocks\AccountData', ); } /** * Get main-column blocks * * @return array */ public function mainColumnBlocks() { return array( 'IPS\membernotes\extensions\core\MemberACPProfileBlocks\Notes', ); } /** * Get right-column blocks * * @return array */ public function rightColumnBlocks() { return array(); } /** * Get Output * * @return string */ public function output() { return parent::output(); } } Mobile phone. No way to use CODE tag. Thank you!
February 26, 2024Feb 26 For others wondering about this.... In order to create a hook for the Admin member profile "main" screen, you create a new Extension for "MemberACPProfileBlocks" Then you need to add a hook to add your Extension to the page. I did that by adding a hook for.. \IPS\core\extensions\core\MemberACPProfileTabs\Main and adding to the "left" or "Main" column arrays to include my new extension class.
February 26, 2024Feb 26 13 minutes ago, Convergent Trading said: For others wondering about this.... In order to create a hook for the Admin member profile "main" screen, you create a new Extension for "MemberACPProfileBlocks" Then you need to add a hook to add your Extension to the page. I did that by adding a hook for.. \IPS\core\extensions\core\MemberACPProfileTabs\Main and adding to the "left" or "Main" column arrays to include my new extension class. Hook? You set the position of your block in the MemberACPProfileTabs extension: public function leftColumnBlocks() { } public function mainColumnBlocks() { } The blocks itself go in the MemberACPProfileBlocks extension. Take a look in \IPS\core\extensions\core\MemberACPProfileTabs\Main and \IPS\core\extensions\core\MemberACPProfileBlocks\ProfileData, for example.
March 1, 2024Mar 1 On 2/26/2024 at 12:30 PM, Adriano Faria said: Hook? You set the position of your block in the MemberACPProfileTabs extension: public function leftColumnBlocks() { } public function mainColumnBlocks() { } The blocks itself go in the MemberACPProfileBlocks extension. Take a look in \IPS\core\extensions\core\MemberACPProfileTabs\Main and \IPS\core\extensions\core\MemberACPProfileBlocks\ProfileData, for example. If i use MemberACPProfileTabs it creates a new tab on the profile screen. I'm not wanting to add this new block to a new tab, i want to add it to the existing main profile tab.
March 1, 2024Mar 1 I see what you mean. Yep, every "top" tab belongs to an app (Core and Nexus by default, if you have it installed). Anyway, you better rethink this as it won't be possible to use hooks in v5 and I don't believe they will allow us to add blocks to core apps. Anyway, only when Beta 1 is out to be sure.