Jump to content

Hook in CMS page


mem.webproject

Recommended Posts

Hi everybody

I'm trying to put a image slider in a CMS page.

I have Prestashop 1.6.1.17

I started creating a new hook with Hooks Manager  by Vekia

Then I insert in cms.tpl this code

{hook h='displaycmsslider'}
	<div class="rte{if $content_only} content_only{/if}">
		{$cms->content}
	</div>

Then I register hook open minicslider.php (the slide show I want to show) and I insert where are the other position declared:

$this->registerHook('displaycmsslider') &&

Then I put at the end of same file this code:

public function hookDisplaycmsslider()
		{
			return $this->hookHome('top');
		}

Then I reset module.

I clear cache, and Force compilation  of template.

In Live Edit I can see the hook (see attach image), but I'm not able to see the slide working.

Could you please help me.

 

Regards

Screenshot-2017-12-3-Delivery---Test.jpg

Link to comment
Share on other sites

to confirm that your hook is being called, change it to this and then confirm that you see 'hookDisplaycmsslider' returned

public function hookDisplaycmsslider()
		{
                        die('hookDisplaycmsslider');
			return $this->hookHome('top');
		}

 

If you do not see it, then your hook is not being called

If you do see it, then it means your call to hookHome is not returning any content, and you will need to further debug that function

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