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
#54
Posted 27 May 2013 - 04:01 PM
#55
Posted 28 May 2013 - 10:07 AM
chopin2256, on 27 May 2013 - 04:01 PM, said:
There is no need in "admin" module, it can be any module what you want, or application itself.
You can read more about controllerMap in CWebApplication class reference
About directory for images – you need to add "gallery" into your web root, and give web server write permitions on that folder.
#56
Posted 30 May 2013 - 12:13 PM
There doesn't seem to be a way to work with images once they've been uploaded. I hit refresh and get the basic gallery navigation (add, select *, edit, etc...) Is this the expected behavior? Does this extension facilitate removing images, editing descriptions, showing a gallery, and such?
I'm not receiving any errors, there's just no way to view or edit the images. They exist in the database and directory structure. Is is by design that we should implement viewing and editing on our own?
#57
Posted 30 May 2013 - 01:34 PM
Paul Sandel, on 30 May 2013 - 12:13 PM, said:
There doesn't seem to be a way to work with images once they've been uploaded. I hit refresh and get the basic gallery navigation (add, select *, edit, etc...) Is this the expected behavior? Does this extension facilitate removing images, editing descriptions, showing a gallery, and such?
I'm not receiving any errors, there's just no way to view or edit the images. They exist in the database and directory structure. Is is by design that we should implement viewing and editing on our own?
Widget has following features: upload, removal, editing description and rearrange images in gallery.
Do you have twitter bootstrap (css and js) on page with gallery manager widget? (may be, because of that you do not see all controls).
About image viewing: this widget intended only for gallery management. So if you need only show images on the site without editing – you need to implement it, there are examples how to do this above in thread.
#58
Posted 30 May 2013 - 04:46 PM
On initial upload the files appear with the file sorter, but if I add a gallery, navigate away, and then return the gallery controls show, just no images. I've implemented as an extension, and am calling from post/gallery. When I visit /post/gallery/1, I expect to see the gallery images but all I receive is 'a no records returned' notice.
#59
Posted 01 June 2013 - 01:20 PM
Paul Sandel, on 30 May 2013 - 04:46 PM, said:
On initial upload the files appear with the file sorter, but if I add a gallery, navigate away, and then return the gallery controls show, just no images. I've implemented as an extension, and am calling from post/gallery. When I visit /post/gallery/1, I expect to see the gallery images but all I receive is 'a no records returned' notice.
Can you show gallery management related code?
Looks like that somewhere you are creating new gallery each time instead of loading previous one.
#60
Posted 25 June 2013 - 06:14 AM
is there a way to specify upload dir?
All the time it compleins dir now writable.
Trying to debug it shows that the directory is / which should not be
I'm in Linux if that is important!