Jump to content

Can you hook Adsense into Footer??


Recommended Posts

  • 10 months later...

I don't know which module it is, but if you add the footer hook to the module file, then it should work.

function hookFooter($params) {
//copy data from the other hook here
}



in the install function at the top of the page you would add -
$this->registerHook(footer);

Then uninstall and re-install the module to register the hook in the footer of the page.

Link to comment
Share on other sites

I'm sorry, I was under the understanding that you have an Adsense module? If you don't, what I said won't really work, as I was inferring to copy/paste code from the other hook in the module.

If you just want to add your code simply, you can go to your theme folder and paste your adsense code into the file called footer.tpl.

to make your own little module. make a folder called adfooter. Now a file called adfooter.php

<?php
class adfooter extends Module {

 function __construct() {

   $this->name = 'adfooter';
   $this->version = '0.1.0';
   $this->tab = 'Ads';
   parent::__construct();

   $this->displayName = $this->l('Simple Ad Footer Module');
   $this->description = $this->l('I use this to put Adsense in my Footer');
 }

 function install()
   {
        if (!parent::install()) {return false;}
        return $this->registerHook('footer');
   }

   public function hookFooter($params)
   {
       return $this->display(__FILE__, 'adfooter.tpl');
   }
}
?>



Now we will make a template file called adfooter.tpl. You will put your adsense code into this file.

put adfooter.php and adfooter.tpl into your adfooter folder and then upload to the modules folder in your shop and install. If you need to add css for a little formatting, you can just add it to the .tpl file, or link to it from the .tpl file. I don't think you are allowed to format Adsense, though, so the most you might use it for is to center it.

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