| 39 | | See the [http://jquery.com/demo/thickbox/ documentation]. |
|---|
| | 39 | First, see the official [http://jquery.com/demo/thickbox/ documentation]. |
|---|
| | 40 | |
|---|
| | 41 | Here are some examples of usage that match the examples on the documentation page: |
|---|
| | 42 | |
|---|
| | 43 | '''Single Image:''' |
|---|
| | 44 | {{{ |
|---|
| | 45 | <?php echo thickbox_image('single_thumb.jpg', 'single.jpg', array('title' => 'Single Image')) ?> |
|---|
| | 46 | }}} |
|---|
| | 47 | |
|---|
| | 48 | Additional options can be set for the thumbnail image like so: |
|---|
| | 49 | {{{ |
|---|
| | 50 | <?php echo thickbox_image('single_thumb.jpg', 'single.jpg', array('title' => 'Single Image'), array('size' => '120x120')) ?> |
|---|
| | 51 | }}} |
|---|
| | 52 | |
|---|
| | 53 | |
|---|
| | 54 | '''Gallery Images:''' |
|---|
| | 55 | {{{ |
|---|
| | 56 | <?php echo thickbox_image('single1_thumb.jpg', 'single1.jpg', array('rel' => 'gallery1', 'title' => 'Single Image 1')) ?> |
|---|
| | 57 | <?php echo thickbox_image('single2_thumb.jpg', 'single2.jpg', array('rel' => 'gallery1', 'title' => 'Single Image 2')) ?> |
|---|
| | 58 | <?php echo thickbox_image('single3_thumb.jpg', 'single3.jpg', array('rel' => 'gallery1', 'title' => 'Single Image 3')) ?> |
|---|
| | 59 | |
|---|
| | 60 | <?php echo thickbox_image('single4_thumb.jpg', 'single4.jpg', array('rel' => 'gallery2', 'title' => 'Single Image 4')) ?> |
|---|
| | 61 | <?php echo thickbox_image('single5_thumb.jpg', 'single5.jpg', array('rel' => 'gallery2', 'title' => 'Single Image 5')) ?> |
|---|
| | 62 | <?php echo thickbox_image('single6_thumb.jpg', 'single6.jpg', array('rel' => 'gallery2', 'title' => 'Single Image 6')) ?> |
|---|
| | 63 | }}} |
|---|
| | 64 | |
|---|
| | 65 | You'll notice this is example is exactly the same as the single image example, except that we're adding a "rel" attribute to the image that will group these images into two sets, "gallery1" and "gallery2." |
|---|
| | 66 | |
|---|
| | 67 | |
|---|
| | 68 | '''Inline Content''' |
|---|
| | 69 | {{{ |
|---|
| | 70 | <?php echo thickbox_inline('Show', 'something_hidden') ?> |
|---|
| | 71 | |
|---|
| | 72 | <div id="something_hidden" style="display:none;"> |
|---|
| | 73 | <p>test</p> |
|---|
| | 74 | </div> |
|---|
| | 75 | }}} |
|---|
| | 76 | |
|---|
| | 77 | You can also add html and thickbox options like so: |
|---|
| | 78 | {{{ |
|---|
| | 79 | <?php echo thickbox_inline('Show', 'something_hidden', array('style' => 'font-weight:bold'), array('size' => '300x400', 'modal' => 'true')) ?> |
|---|
| | 80 | }}} |
|---|
| | 81 | |
|---|
| | 82 | |
|---|
| | 83 | '''IFramed Content''' |
|---|
| | 84 | {{{ |
|---|
| | 85 | <?php echo thickbox_iframe('Google in a thickbox', 'http://google.com') ?> |
|---|
| | 86 | }}} |
|---|
| | 87 | |
|---|
| | 88 | |
|---|
| | 89 | '''AJAX Content''' |
|---|
| | 90 | {{{ |
|---|
| | 91 | <?php echo thickbox_ajax('Signin via thickbox', '@sf_guard_signin') ?> |
|---|
| | 92 | }}} |
|---|
| | 93 | |
|---|
| | 94 | Additional html and thickbox options can also be set in the same manner as with the inline content for both iframe and ajax content. |
|---|
| | 95 | |
|---|
| | 96 | Also, as can be seen in the ajax content example, any symfony routing rule can be used for a url. |
|---|