Jump to content

Move category description to the sidebar


Recommended Posts

Hi all

 

i've been struggeling with this issue for some days now and i cant seem to figure it out.

hope there is someone with a solution here...

 

what i want is to "simply" move my category description to the sidebar right under the category block

 

i figured the best way to do this is to create a module that can print: {$category->description}

however im not good with smarty so this simple task turns out to be very hard lol

 

Am i doing this right ? can someone point me in the right direction ?

any help will be much appreciated

 

greetings

Link to comment
Share on other sites

Creating a module for this is the right way to do it.

In your module install() function add $this->registerHook('displayRightColumn'); to transplant the module on the right sidebar.

 

Create the function that will run on that hook:

public function hookDisplayRightColumn($params) {
    $this->context->smarty->assign('category_description', $this->context->controller->getCategory()->description);

    return $this->display(__FILE__, 'displayRightColumn.tpl');
}

This function assigns the smarty variable $category_description and displays file displayRightColumn.tpl.

In YOUR_MODULE/views/templates/hook create file displayRightColumn.tpl and add the smarty variable:

{$category_description} 
Edited by gabdara (see edit history)
  • Like 1
Link to comment
Share on other sites

  • 7 years later...

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...