Gallery Manager extension nice widget to manage images gallery
#41
Posted 19 January 2013 - 10:32 AM
About file mixins.less - probably, you have relative url to it(but because you are using path url format, you should use absolute path ("/path/to/file" not "path/to/file").
About "/index.php/ajaxUpload/gallery_id/4", it also seems to be wrong..
Check:
- urlManager rules, does there is correct rules for gallery controller?
- 'controllerRoute' property of gallery manager, does it points to gallery controller?
#42
Posted 25 February 2013 - 02:56 PM
$this->widget('GalleryManager', array(
'gallery' => $gallery,
'controllerRoute' => 'admin/gallery', //route to gallery controller
Если поточнее, controllerRoute к какому контроллеру ведет? Относительно чего этот путь?
#43
Posted 27 February 2013 - 04:11 PM
James Linden, on 25 February 2013 - 02:56 PM, said:
$this->widget('GalleryManager', array(
'gallery' => $gallery,
'controllerRoute' => 'admin/gallery', //route to gallery controller
Если поточнее, controllerRoute к какому контроллеру ведет? Относительно чего этот путь?
Это путь должен вести к контроллеру из расширения(GalleryController), путь зависит от того куда подключен контроллер. В приведенном примере контроллер подключен как gallery в controllerMap модуля admin.
#45
Posted 28 February 2013 - 03:26 AM
jacmoe, on 27 February 2013 - 05:44 PM, said:
Sure
Question was about controllerRoute in widget properties. To what controller it should point? And where that controller should be?
Answer was:
This route should point to GalleryController from extension. Actual route depends where controller is connected, in this example controller is added as "gallery" in controllerMap for admin module.
#47
Posted 06 March 2013 - 05:45 AM
rashmani, on 18 January 2013 - 06:20 PM, said:
I've been reading and checking all the material you've setup (btw, thanks a ton!), including the test-app, which works fine on my local test server. Then I've switched to my project, installed the extension and loaded the image and bootstrap components in my main config. Finally, I've added the Controller to my controllerMap, such as:
'controllerMap' => array(
'gallery'=>array(
'class'=>'ext.galleryManager.GalleryController',
'pageTitle'=>'Gallery administration',
),
),
I want to use the GalleryBehavior with one of my models (model Structure) so I've added this to my model code:
public function behaviors()
{
return array(
'galleryBehavior' => array(
'class' => 'application.extensions.galleryManager.GalleryBehavior',
'idAttribute' => 'gallery_id',
'versions' => array(
'small' => array(
'centeredpreview' => array(98, 98),
),
'medium' => array(
'resize' => array(800, null),
)
),
'name' => true,
'description' => true,
)
);
}
And to my model's view:
<?php
if ($model->galleryBehavior->getGallery() === null) {
echo '<p>Before add photos to product gallery, you need to save product</p>';
} else {
$this->widget('application.extensions.galleryManager.GalleryManager', array(
'gallery' => $model->galleryBehavior->getGallery(),
));
}
?>Problem is, when i call my view I get an error, file mixins.less not found, but the gallery panel gets loaded. Clicking to add images lets you choose images, but it calls an obviously wrong action (http://localhost:808...ad/gallery_id/4) and then it throws a new error while responding
Unable to resolve the request "ajaxUpload/gallery_id".
What am I doing wrong?
Thanks in advance for any hint, document or suggestion you may provide.
rash*
Hi, did you solved your problem?
I also inserted 'controllerMap' array into config/main.php and i added a 'controllerRoute' array into the widget call at the view file like this and it works now.
<?php
$this->widget('GalleryManager', array(
'gallery' => $gallery,
'controllerRoute' => 'gallery', //route to gallery controller
));
?>
I am working now on adding the widget to a model.
Bye
László from Hungary
#48
Posted 08 March 2013 - 06:44 AM
Quote
Display them it does not do? I mean as a gallery?
At least I was not able to achieve this. For example, in the control panel I load the image, and how they then bring to the front, only third-party extensions, or write your own?
#49
Posted 09 March 2013 - 05:26 AM
Mongol, on 08 March 2013 - 06:44 AM, said:
I understand this extension is only used to download images of the server?
Display them it does not do? I mean as a gallery?
At least I was not able to achieve this. For example, in the control panel I load the image, and how they then bring to the front, only third-party extensions, or write your own?
Not only upload - also you can arrange images, edit associated information.
But there is no widget in extension for displaying gallery on frontend. You can use other extensions for this, or simply do this by hand, for example:
foreach ($product->galleryBehavior->getGalleryPhotos() as $photo) {
echo CHtml::link(
CHtml::image($photo->getUrl('small'), $photo->name . ' ' . $photo->description),
$photo->getUrl('medium')
);
}
#50
Posted 09 March 2013 - 05:53 AM
Bogdan Savluk, on 09 March 2013 - 05:26 AM, said:
But there is no widget in extension for displaying gallery on frontend. You can use other extensions for this, or simply do this by hand, for example:
foreach ($product->galleryBehavior->getGalleryPhotos() as $photo) {
echo CHtml::link(
CHtml::image($photo->getUrl('small'), $photo->name . ' ' . $photo->description),
$photo->getUrl('medium')
);
}
Спасибо за ответ!
Quote
#51
Posted 10 March 2013 - 04:39 AM
Bogdan Savluk, on 09 March 2013 - 05:26 AM, said:
But there is no widget in extension for displaying gallery on frontend. You can use other extensions for this, or simply do this by hand, for example:
foreach ($product->galleryBehavior->getGalleryPhotos() as $photo) {
echo CHtml::link(
CHtml::image($photo->getUrl('small'), $photo->name . ' ' . $photo->description),
$photo->getUrl('medium')
);
}
Hi Bogdan,
I am trying to put into the front-end my galleries using the above code. I successfully attached the gallery to my model, so i can upload photos to my model entities. But in my case $model->galleryBehavior is a non-object and therefore my error message is " Call to a member function getGalleryPhotos() on a non-object in /home/..../themes/soccer/views/site/home.php on line 127"
I'm not an expert of using behaviors so please help! Thank You
László from Hungary
#52
Posted 10 March 2013 - 04:59 AM
tihanyilaci, on 10 March 2013 - 04:39 AM, said:
I am trying to put into the front-end my galleries using the above code. I successfully attached the gallery to my model, so i can upload photos to my model entities. But in my case $model->galleryBehavior is a non-object and therefore my error message is " Call to a member function getGalleryPhotos() on a non-object in /home/..../themes/soccer/views/site/home.php on line 127"
I'm not an expert of using behaviors so please help! Thank You
László from Hungary
Hi Bogdan, problem solved I rendered the $model variable in the wrong way.
Best wishes, still a great extension
László from Hungary

Help











