Jump to content

add fancybox in cms


ilario

Recommended Posts

Thanks for the response but I did not understand

So I resolved, it can be useful to someone

 

in CMSController.php

public function setMedia()
    {
        parent::setMedia();

        if ($this->assignCase == 1) {
            $this->addJS(_THEME_JS_DIR_.'cms.js');
        }

        $this->addCSS(_THEME_CSS_DIR_.'product.css');
    	$this->addCSS(_THEME_CSS_DIR_.'cms.css');
    	$this->addCSS(_PS_CSS_DIR_.'jquery.fancybox.css', 'screen');
    	$this->addJqueryPlugin('fancybox');
    
    }

in cms.tpl

<script type="text/javascript">
$(document).ready(function() {
$('a.iframe').fancybox({
		'type' : 'iframe',
		'width':600,
		'height':600
	});
});
</script>

in page cms

<a class="iframe" href="/shop/index.php?id_cms=11&controller=cms&content_only=1">

I would like to override the file CMSController.php, but I always error how can I do?

 

​ciao

ilario

Link to comment
Share on other sites

First of all glad to see.

Place cmscontroller.Php in /override /controllers/

 

It should be like as follows :

Cmscontroller extends cmscontrollercore.

 

Then clear cache folders along with class_index.php file.

hi

i put  the file  cmscontroller.Php in /override /controllers/front

 

<?php


class CmsController extends CmsControllerCore
{
public function setMedia()
    {
        parent::setMedia();

        if ($this->assignCase == 1) {
            $this->addJS(_THEME_JS_DIR_.'cms.js');
        }

        $this->addCSS(_THEME_CSS_DIR_.'product.css');
    	$this->addCSS(_THEME_CSS_DIR_.'cms.css');
    	$this->addCSS(_PS_CSS_DIR_.'jquery.fancybox.css', 'screen');
    	$this->addJqueryPlugin('fancybox');
    
    }
}

and clear  class_index.php file

 

but there is an error, blank page,

where am I wrong?

Link to comment
Share on other sites

  • 1 month 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...