Jump to content

How to hook content from within a module's controller?


Recommended Posts

Hello,

I know you can use:

public function hookDisplayLeftColumn() {
  return '
 	 abc
  ';
}

In your main module file after registering a hook, but how do you do the exact same thing from within a controller?

My reasoning for wanting this is that I have a new product page, and want to display custom content (categories/filter etc) within the leftcolumn. The controller has all of the queries already loaded for the content in the leftcolumn, and I'd like to not have to call them again for the main file.

 

Thanks,

Luke

Link to comment
Share on other sites

2 hours ago, Krystian Podemski said:

I think what you want to do is: 

$leftColumn = Hook::exec('displayLeftColumn');

// and there you probably need to pass this to the view :-)

 

Hello,

Thanks for the reply.

I believe you're getting and storing the left column in that variable.

What I'd like is to have the text 'abc' sit at the top of the left column, which is set in my module's controller.

 

Thanks,

Luke

Edited by luke.lukas (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...