Yii Framework Forum: ThickBox Implementation - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

ThickBox Implementation Rate Topic: -----

#1 User is offline   Ramin 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 13
  • Joined: 08-February 09

Posted 16 February 2009 - 11:16 PM

How to implement the ThickBox(http://jquery.com/demo/thickbox/) within a project that powered by Yii?
0

#2 User is offline   ironic 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 32
  • Joined: 09-January 09
  • Location:Germany

Posted 17 February 2009 - 06:26 AM

Quote

How to implement the ThickBox(http://jquery.com/demo/thickbox/) within a project that powered by Yii?


Hello Ramin,
I think the smartest way, would be to build an extension, which wrap the functionallity of the thickbox script.

In this case, the required Steps are:
1. publish and register the clientside files like .css and .js
2. build and output the required markup (html)

I attached an unfinished version, how this could look like.
At the moment it features the "single image" and "image gallery" mode.
I leave it to you to implement the 3 remaining modes ('inline', 'iframed' and 'ajax').

Download it here.
Unpack it to the "protected/extensions" folder of your yii project.

For a single image use:

<?php
$this->widget('application.extensions.thickbox.EThickbox',
array(
'mode'=>'image',
'data'=>array('images/yii-powered.png', 'images/logo.gif', 'Yii rocks...')
)
);
?>


or for a gallery:

<?php
$this->widget('application.extensions.thickbox.EThickbox',
array(
'mode'=>'gallery',
'data'=>array(
array('images/plant1_t.jpg', 'images/plant1.jpg', 'description text...'),
array('images/plant2_t.jpg', 'images/plant2.jpg', 'another description text...')
)
)
);
?>


And remeber, this should just be an example for you, how to build an extension and not a complete wrap up for the thickbox script.
Ahh and it seems that thickbox has some troubles with jquery 1.3.0 which comes with yii 1.0.2.

greets ironic

Attached File(s)


0

#3 User is offline   Ramin 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 13
  • Joined: 08-February 09

Posted 18 February 2009 - 12:13 AM

Excellent! Thank you for the clear answer.

Regards,
Ramin
0

#4 User is offline   Spyros 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 461
  • Joined: 14-April 09
  • Location:Athens - Greece

Posted 22 April 2009 - 05:49 AM

Thanks, it worked for me .
The issue with jQuery 1.3.0 is that the gallery mode won't work.
It's fixed by changing thickbox.js line 79 from
to



0

#5 User is offline   makseli 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 19-June 12

Posted 26 June 2012 - 09:56 AM

i can't download for "thickbox.zip (21.92K)"

error: [#10173] We could not find the attachment you were attempting to view.
0

#6 User is offline   wisp 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 192
  • Joined: 04-February 11

Posted 01 July 2012 - 09:35 AM

Note that thickbox has not been maintained since 2009
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users