Jump to content
thirty bees forum
  • 0

Is it possible to hook modules into CMS pages?


movieseals

Question

19 answers to this question

Recommended Posts

  • 0

After modifying the code in cms.tpl, assuming you did it right, as that tutorial is pretty old, and the code is different in tb. And after you modified your module you wanted to add to the cms page, did you then reset that module, so the new hook would become active?

Link to comment
Share on other sites

  • 0

and...in the top of the module, under function install, does it have a line similar to this: || !$this->registerHook('displayHomeTab')

It needs to have that hook, and then the new hook you add to it: || !$this->registerHook('customCMS')

for this to work. Plus of course the new function you added to the module: public function hookcustomCMS($params) { return $this->hookDisplayHome($params); }

Link to comment
Share on other sites

  • 0

I followed @Nemo 's tutorial, adding the hook to module homefeatured, and it worked just as he said, in tb103 and in tb104. So you must have done something wrong. Lets figure out what it is.... To start with answer my last question, and we'll go from there.

You might start fresh, and modify homefeatured like the example was, and see if you can get that working, and if you can, go back to modifying your Testimonials module. Thats a pretty simple module, I suspect your Testimonials module is not.

Link to comment
Share on other sites

  • 0
/**  Function Install Module **/
    public function install()
    {
        if (parent::install()
            && $this->registerHook('actionShopDataDuplication')
            && $this->registerHook('home')
            && $this->registerHook('displayHeader')
            && $this->registerHook('customCMS_AFTER'))
        {
            $this->setDataBase('add');
            $this->installDemo();
            return true;
        }
        return false;
    }
Link to comment
Share on other sites

  • 0

change this: && $this->registerHook('customCMS_AFTER')) to this: && $this->registerHook('customCMS'))

Then reset the module. This is assuming that you setup your hook in the module like this: public function hookcustomCMS($params) { return $this->hookDisplayHome($params); }

The functions name, and the registerhooks name needs to be the same. in this case hookcustomCMS

Link to comment
Share on other sites

  • 0

I did a customCMSBEFORE and a customCMSAFTER, inside the CMS page, as described in the tutorial, so that I could put stuff before or after the CMS code itself. Hence the labeling. But I do know that they need to match everywhere (and currently they do).

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