We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Control Panel Homepage Hooks

Development and Programming

Michael Hay's avatar
Michael Hay
65 posts
17 years ago
Michael Hay's avatar Michael Hay

Hi

I was hoping someone could give me an example of how to use the control_panel_home_page_left_option or the control_panel_home_page_right_option hooks. I am confused on how to add a ‘possible method to the $this->methods class variable’.

Many thanks Michael

       
Michael Hay's avatar
Michael Hay
65 posts
17 years ago
Michael Hay's avatar Michael Hay

Can anyone help with this?

       
Justin Hurlburt's avatar
Justin Hurlburt
344 posts
17 years ago
Justin Hurlburt's avatar Justin Hurlburt

Greetings,

Could you elaborate a bit more on what you would like to achieve? =)

       
Michael Hay's avatar
Michael Hay
65 posts
17 years ago
Michael Hay's avatar Michael Hay

On the control panel homepage there are various panels shown on the left and right hand side. For example there is a site statistics table on one side. I would like to add a customised table of data underneath the two sides.

I have managed to work the control_panel_home_page hook but this only adds details to the top of the homepage. I am confused on how the control_panel_home_page_left_option or the control_panel_home_page_right_option hooks work. The details available (http://expressionengine.com/developers/extension_hooks/) don’t ellaborate much.

Apparently I need to add a method to my extension but am unsure of the syntax to achieve this.

       
Michael Hay's avatar
Michael Hay
65 posts
17 years ago
Michael Hay's avatar Michael Hay

Can you help with this?

       
Justin Hurlburt's avatar
Justin Hurlburt
344 posts
17 years ago
Justin Hurlburt's avatar Justin Hurlburt

Sorry about the delay. Would this be one large frame spanning the page at the bottom, or two individual frames on the left and right side?

       
Justin Hurlburt's avatar
Justin Hurlburt
344 posts
17 years ago
Justin Hurlburt's avatar Justin Hurlburt

Also, a suggestion would be to write a simple extension using one of the hooks that just returns a generic string like ‘hi!’. You could change the hook and see each time where the string appears.

       
Michael Hay's avatar
Michael Hay
65 posts
17 years ago
Michael Hay's avatar Michael Hay

I’d like to get it working so that the individual frames on either side appear. I’ve managed to get an extended frame at the top to appear but I’m having trouble getting the hook to work for the right and left frames.

       
Justin Hurlburt's avatar
Justin Hurlburt
344 posts
about 17 years ago
Justin Hurlburt's avatar Justin Hurlburt

Could you elaborate a bit more on ‘having trouble’? Is there an error, are you unsure of a how to return data, etc..

       
Michael Hay's avatar
Michael Hay
65 posts
about 17 years ago
Michael Hay's avatar Michael Hay

I can get the control_panel_home_page hook to work in an extension.

I can’t get the control_panel_home_page_left_option or the control_panel_home_page_right_option hooks working.

Nothing appears when I use either of these two hooks.

It says in the documentation for these two hooks that I need to define a method.

http://expressionengine.com/developers/extension_hooks/control_panel_home_page_left_option/ http://expressionengine.com/developers/extension_hooks/control_panel_home_page_right_option/

Do you know the syntax to define these methods?

I think this is the reason for it not working.

       
Justin Hurlburt's avatar
Justin Hurlburt
344 posts
about 17 years ago
Justin Hurlburt's avatar Justin Hurlburt

I was able to dig up this thread http://ellislab.com/forums/viewthread/32218/ which has the answer within it. You need to get the method into the the $left or $right array, which occurs starting at line 220 of cp.home.php. Let us know if you have any questions!

       
Michael Hay's avatar
Michael Hay
65 posts
about 17 years ago
Michael Hay's avatar Michael Hay

Got it working. Thanks Justin.

       
Justin Hurlburt's avatar
Justin Hurlburt
344 posts
about 17 years ago
Justin Hurlburt's avatar Justin Hurlburt

Glad to hear we could figure that one out! =) Let us know if you have any questions at all.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.