Yii Framework Forum: Gallery Manager extension - Yii Framework Forum

Jump to content

  • (3 Pages)
  • +
  • 1
  • 2
  • 3
  • You cannot start a new topic
  • You cannot reply to this topic

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

#41 User is offline   Bogdan Savluk 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 34
  • 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: 34
  • 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"
0

#45 User is offline   Bogdan Savluk 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 34
  • 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: 20
  • 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: 34
  • 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: 20
  • 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: 20
  • 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

Share this topic:


  • (3 Pages)
  • +
  • 1
  • 2
  • 3
  • 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