Yii 1.1: piecemakerwidget

Flash based sleek image slider fully xml driven, now encapsulated as a widget with support for automatic xml creation.

PieceMaker2 image slider by ModularWeb now in a widget with easy configuration options.


I am using Yii 1.1.7 but also tested it on Yii 1.1.6.


Example code to embed this widget:

<!-- Sample code to insert piecemaker widget into view files. -->
<div id="piecemaker-container" class="span-22 prepend-1 append-1">
    <?php $this->widget('application.extensions.piecemaker.PieceMaker', array(
                'image' /*type*/,
                'images/gallery/Fly Agaric Fly Hawaii.jpg' /*url*/,
                'Fly Agaric Fly Hawaii' /*title*/,
                '<p><em>Photo Source:<em>&nbsp;DeviantArt</p>' . PHP_EOL /*info*/,
                'http://www.yiiframework.com/extension/piecemakerwidget/' /*link*/,
                '_page' /*link-target*/,
                'image', 'images/gallery/Ford Mustang.jpg', 'Ford Mustang',
                /* These three params are required. */
                'images/demo/flash-preview.png' ),
                800 /*width*/,
                450 /*height*/,
                true /*autoplay video?*/,
                'images/demo/video-preview.jpg' ),
            array(  9 /*pieces*/,
                    1.2 /*time*/,
                    'easeInOutBack' /*transition*/,
                    0.1 /*delay*/,
                    300 /*depth-offset*/,
                    30 /*cube-distance*/ ),
            array(15, 3, 'easeInOutElastic', 0.03, 200, 10),
            array(5, 1.3, 'easeInOutCubic', 0.1, 500, 50),
            array(9, 1.25, 'easeInOutBack', 0.1, 900, 5),
    )); ?>


Total 8 comments

#4804 report it
Hindol at 2011/08/18 05:13am
Thanks Drumaddict

Sorry, I have been out of touch with this extension for a long time.

I am glad that you have found and fixed the problem. I have never tested this with multiple instances. Anyway rewriting the assets folder on every page is bad for performance reasons. Maybe it should maintain multiple assets folders, one for each instance.

I'll look into it.

#4789 report it
drumaddict at 2011/08/16 06:51pm
Problems when used in Apache Server,more than one instance

I use Piecemaker in two different pages in my website.Locally in my localhost ,the piecemaker.xml file,is rewritten for every page and published in the assets folder.So it works OK.Live on the server though,the piecemaker.xml is overwritten in the extensions folder but cannot be published to the assets folder.So the same set of images is displayed nomatter what page is visited.I tried changing all the permissions to 0777 both in the extensions folder and in the published assets folder,but no luck.I will appreciate your help.

UPDATE The problem is in Piecemaker.php file :

$this->assetsUrl = Yii::app()->getAssetManager()->publish(

The fourth parameter in publish is the source of the problem.It worked locally with two galleries because I was in debug mode so YII_DEBUG=true which means force copy assets folder even if it exists,so everytime the xml file changes (for every gallery) it gets published and the new gallery shows up.In production mode however,this parameter is false,so the assets folder is not overwritten so the xml file is always the same,and only one gallery is shown.A solution is to replace YII_DEBUG with true,but ofcourse we have a little performance issue,since the assets folder gets published every time we switch from one gallery to another. I hope I saved some ppl from serious headache!

#4681 report it
drumaddict at 2011/08/03 07:58pm

I noticed that greek characters do not get rendered for title and description.No language support??

#3499 report it
Hindol at 2011/04/15 10:47am

Sorry it should have read "just modify the <Settings> node within defaults.xml in the extensions folder." Really should have previewed.

I have the demo a bit. The buttons are now centered and I have added an Info node for every image. Uploading the updated files now.

#3498 report it
Hindol at 2011/04/15 10:41am
Thanks DrumAddict

Haha, already a promise for extension of my work, :). For your benefit, I must tell you something.

The PieceMaker 2 slider by ModularWeb has a vast array of options. I did not try to figure out what each option does. And I didn't add a way to configure those options form within the view files as it would become cumbersome.

So if you want to tweak the widget's settings, just modify the node within defaults.xml in the extensions folder.

#3497 report it
nettrinity at 2011/04/15 10:31am
It's so beautiful!

I love it!

#3496 report it
drumaddict at 2011/04/15 09:46am

Looks awesome,I will integrate this with my nivoSliderManagement extension so that images can be easily managed by the end user...

#3494 report it
Hindol at 2011/04/15 07:35am
You can also add flash or video content.


'contents' => array(
    array('images/demo/flash.swf', 'Title', 'images/demo/flash-preview.png'),
    array('images/demo/video.mp4', 'Title', 800 /*width*/, 450 /*height*/,
        true /*autoplay video?*/, 'images/demo/video-preview.jpg'),

Note that the video url must be relative to the piecemaker.swf object so a '../../' is prepended to the video url internally. Just something to keep in mind when the video doesn't work.

Leave a comment

Please to leave your comment.

Create extension