Gallery Manager extension

Hi,

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?

Богдан, в вызове виджета

$this->widget(‘GalleryManager’, array(

‘gallery’ => $gallery,

‘controllerRoute’ => ‘admin/gallery’, //route to gallery controller

Если поточнее, controllerRoute к какому контроллеру ведет? Относительно чего этот путь?

Это путь должен вести к контроллеру из расширения(GalleryController), путь зависит от того куда подключен контроллер. В приведенном примере контроллер подключен как gallery в controllerMap модуля admin.

Could you translate? I’m curious. :)

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.

Thanks a lot Bogdan :)

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

        &#036;this-&gt;widget('GalleryManager', array(


            'gallery' =&gt; &#036;gallery,


            'controllerRoute' =&gt; 'gallery', //route to gallery controller


        ));


        ?&gt;

I am working now on adding the widget to a model.

Bye

László from Hungary

Я так понимаю данное расширение используется исключительно для загрузки изображений не сервер? Выводом этих изображений оно не занимается? Я имею ввиду как галерея? По крайней мере мне не удалось добиться этого. Например в панели управления я загружаю изображения, а как их потом вывести на фронтальной части, исключительно сторонними расширениями, или писать свои?

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')

             ); 

}



Спасибо за ответ!

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

Hi Bogdan, problem solved I rendered the $model variable in the wrong way.

Best wishes, still a great extension

László from Hungary

so you are looking for image control

I don’t understand what /admin/gallery/ is (I don’t have a need for the admin module), and the documentation contains little information about what a controllerMap is or how to set it up. I also don’t understand where to set up the upload directory.

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.

This extension looks promising. Thanks for sharing.

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.

Yes, I have the twitter requisites in place.

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.

Hi Bodgan,

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!