Jump to content

Thickbox in cms pages 1.4


Recommended Posts

  • 1 month later...
  • 2 months later...

Hi,

 

After one month of demand finally the solution ...

 

In the folder "override \ controllers" create file "CMSController.php" with the following code:

 

 

 

<?php

 

class CmsController extends CmsControllerCore {

 

public function setMedia() {

parent::setMedia();

 

Tools::addCSS(_PS_CSS_DIR_.'jquery.fancybox-1.3.4.css', 'screen');

 

Tools::addJS(array(_PS_JS_DIR_.'jquery/jquery.fancybox-1.3.4.js',

_PS_JS_DIR_.'jquery/jquery.serialScroll-1.2.2-min.js',

_THEME_JS_DIR_.'product.js'));

 

if (Configuration::get('PS_DISPLAY_JQZOOM') == 1) {

Tools::addCSS(_PS_CSS_DIR_.'jqzoom.css', 'screen');

Tools::addJS(_PS_JS_DIR_.'jquery/jquery.jqzoom.js');

}

}

}

 

 

 

 

Add the class "thickbox" to the image you want to open in modal window

 

 

See the effect created on my website

 

 

 

After all is very simple

 

Can see more information on:

http://www.rolandl.f...s-les-pages-cms

 

Je remercie Ludovic Roland

 

 

HV

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 months later...
  • 1 month later...
  • 9 months later...
  • 1 month later...

Hi, :)

I up this post cause this method doesn't work for videos.

Indeed, i'd like to open videos in CMS with Fancybox, like on this website :

http://www.actionpro.de/alt/videosSD21.html

 

(I'm on PS v1.4.9 )

 

So, i created the file CMSController.php, with the code written previously in this topic, and put the file in override/controllers.

And I've added this code in my CMS to test :

<a class="thickbox" href="http://www.youtube.com/watch?v=F_rEHfLgdcY"><img src="http://www.my-website.com/img/test.jpg" alt="" width="800" height="448" /></a>

 

The only result I get is when i click on the image "test.jpg", a loading animation like this one :

http://www.google.fr/imgres?q=loading+gif&um=1&sa=N&biw=1920&bih=955&hl=fr&tbm=isch&tbnid=9rvBEbPXvUM4PM:&imgrefurl=http://www.pol-fraiture.be/fr-photos%2Bview%2B35&docid=U6AKPXoOLOUOdM&imgurl=http://www.pol-fraiture.be/img/loading.gif&w=800&h=800&ei=XaaoUZycJcOYhQf1y4D4Cg&zoom=1&iact=hc&vpx=4&vpy=147&dur=652&hovh=225&hovw=225&tx=71&ty=102&page=1&tbnh=138&tbnw=131&start=0&ndsp=51&ved=1t:429,r:0,s:0,i:160

appears, but is always loading and loading : the video never opens ?!

 

Anybody to help me please ?

Link to comment
Share on other sites

  • 1 month later...

hello

 

open FrontController.php file located in the classes/controller/ directory

 

you've got there setmedia function

at the end of this function and right before the

Hook::exec('actionFrontControllerSetMedia', array());

add this code:

 

$this->addjqueryPlugin('fancybox');
$this->addCSS(_PS_CSS_DIR_.'jquery.fancybox-1.3.4.css', 'all'); // @TODO

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