Yii Framework Forum: Gallery Manager extension - Yii Framework Forum

Jump to content

  • (7 Pages)
  • +
  • 1
  • 2
  • 3
  • 4
  • 5
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

Gallery Manager extension nice widget to manage images gallery Rate Topic: ****- 2 Votes

#41 User is offline   Bogdan Savluk 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 65
  • Joined: 20-April 10
  • Location:Kiev

Posted 19 January 2013 - 10:32 AM

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?
0

#42 User is offline   James Linden 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 16-June 12

Posted 25 February 2013 - 02:56 PM

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

$this->widget('GalleryManager', array(
'gallery' => $gallery,
'controllerRoute' => 'admin/gallery', //route to gallery controller


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

#43 User is offline   Bogdan Savluk 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 65
  • Joined: 20-April 10
  • Location:Kiev

Posted 27 February 2013 - 04:11 PM

View PostJames 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.
0

#44 User is offline   jacmoe 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 2,601
  • Joined: 10-October 10
  • Location:Denmark

Posted 27 February 2013 - 05:44 PM

Could you translate? I'm curious. :)
"Less noise - more signal"
1

#45 User is offline   Bogdan Savluk 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 65
  • Joined: 20-April 10
  • Location:Kiev

Posted 28 February 2013 - 03:26 AM

View Postjacmoe, on 27 February 2013 - 05:44 PM, said:

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.
1

#46 User is offline   jacmoe 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 2,601
  • Joined: 10-October 10
  • Location:Denmark

Posted 28 February 2013 - 09:10 AM

Thanks a lot Bogdan :)
"Less noise - more signal"
0

#47 User is offline   tihanyilaci 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 29
  • Joined: 29-July 11

Posted 06 March 2013 - 05:45 AM

View Postrashmani, on 18 January 2013 - 06:20 PM, said:

Hi Bogdan,

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
0

#48 User is offline   Mongol 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 08-March 13

Posted 08 March 2013 - 06:44 AM

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

Quote

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?


0

#49 User is offline   Bogdan Savluk 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 65
  • Joined: 20-April 10
  • Location:Kiev

Posted 09 March 2013 - 05:26 AM

View PostMongol, 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')
             ); 
}

0

#50 User is offline   Mongol 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 08-March 13

Posted 09 March 2013 - 05:53 AM

View PostBogdan Savluk, on 09 March 2013 - 05:26 AM, said:

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



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

Quote

Thanks for the reply!

0

#51 User is offline   tihanyilaci 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 29
  • Joined: 29-July 11

Posted 10 March 2013 - 04:39 AM

View PostBogdan Savluk, on 09 March 2013 - 05:26 AM, said:

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
0

#52 User is offline   tihanyilaci 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 29
  • Joined: 29-July 11

Posted 10 March 2013 - 04:59 AM

View Posttihanyilaci, on 10 March 2013 - 04:39 AM, said:

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
0

#53 User is offline   adimage 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 20-May 13

Posted 20 May 2013 - 02:28 AM

so you are looking for image control
0

#54 User is offline   chopin2256 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 02-May 13

Posted 27 May 2013 - 04:01 PM

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.
0

#55 User is offline   Bogdan Savluk 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 65
  • Joined: 20-April 10
  • Location:Kiev

Posted 28 May 2013 - 10:07 AM

View Postchopin2256, on 27 May 2013 - 04:01 PM, said:

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.
0

#56 User is offline   Paul Sandel 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 12-May 13
  • Location:Florida, United States

Posted 30 May 2013 - 12:13 PM

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?
0

#57 User is offline   Bogdan Savluk 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 65
  • Joined: 20-April 10
  • Location:Kiev

Posted 30 May 2013 - 01:34 PM

View PostPaul Sandel, on 30 May 2013 - 12:13 PM, said:

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.
0

#58 User is offline   Paul Sandel 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 12-May 13
  • Location:Florida, United States

Posted 30 May 2013 - 04:46 PM

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.
0

#59 User is offline   Bogdan Savluk 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 65
  • Joined: 20-April 10
  • Location:Kiev

Posted 01 June 2013 - 01:20 PM

View PostPaul Sandel, on 30 May 2013 - 04:46 PM, said:

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.
0

#60 User is offline   Stefano Mtangoo 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 228
  • Joined: 02-January 12
  • Location:Dar es Salaam, Tanzania

Posted 25 June 2013 - 06:14 AM

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!
And God said, Let there be science...and it was so!
Training Manager Written in Yii here
0

Share this topic:


  • (7 Pages)
  • +
  • 1
  • 2
  • 3
  • 4
  • 5
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users