Yii Framework Forum: Gallery Manager extension - Yii Framework Forum

Jump to content

  • (7 Pages)
  • +
  • « First
  • 5
  • 6
  • 7
  • 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

#121 User is offline   Sachy 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 177
  • Joined: 01-December 13

Posted 29 August 2014 - 04:35 PM

ok after a long time of setting up the code. I got it working somehow and I can see the image gallery on screen!
but i get the following message
Before add photos to product gallery, you need to save product

what shall I do now? pls see attached screenshot

Attached File(s)


0

#122 User is offline   Bogdan Savluk 

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

Posted 29 August 2014 - 07:33 PM

View PostSachy, on 29 August 2014 - 04:35 PM, said:

ok after a long time of setting up the code. I got it working somehow and I can see the image gallery on screen!
but i get the following message
Before add photos to product gallery, you need to save product

what shall I do now? pls see attached screenshot


It looks like you are tring to manage gallery of not existing product (model is not saved into database, so there is no gallery because there is no object where to attach it...)

The way how gallery behaviour is working is:
- on a first save(after behaviour was added to model) it creates gallery, with provided configurations, for a model and saves its id in specified field
- when you are rendering GalleryManager widged created gallery is used to load initial list of photo and to configure widget
- after widget is renderd it can be used to manage gallery by "talking" to GalleryController using Id of an gallery
- when model is deleted from database Gallery behaviour will remove related gallery and all images in it

---

About your question("what shall I do now?"):
1. read the documentation, one more time
2. look an example: https://bitbucket.or...a/yii-demo-blog
3. look at extension source code - it is not too complicated, but this would make it much more clear - how extension works
4. read topics in this thread - I believe, that almost every common issue is covered here.
5. If you still have questions ask there, but please ask questions that can be answered(if do not understood something concreate, or want to achive something and need an advice, and so on... but not like this one (for me it sounds literally like: "I have done something weird. What shall I do next?")

---

About you comment on extension page:
http://www.yiiframew...manager/#c18038

Problem why that code is not working, is not about extension... it is because you are not understanding basic concepts how yii framework works: you should not call $this->widget from controller - you should do this in view that should be rendered using CController::render method, othervise widget would not be able to register styles and scripts using Yii::app()->clientScript

Better remove that comment from extension page - it is question, not a comment.. it is not about an extension, it is completely useless for anyone...
0

#123 User is offline   Sachy 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 177
  • Joined: 01-December 13

Posted 30 August 2014 - 11:04 AM

Taking back all my comments!! Extension works fantastically! Thanks Bogdan
0

#124 User is offline   Sachy 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 177
  • Joined: 01-December 13

Posted 14 September 2014 - 10:11 AM

View PostSachy, on 30 August 2014 - 11:04 AM, said:

Taking back all my comments!! Extension works fantastically! Thanks Bogdan


Hi Bogdan

In the controller action of Gallery Controller
/**
     * Method to handle file upload thought XHR2
     * On success returns JSON object with image info.
     * @param $gallery_id string Gallery Id to upload images
     * @throws CHttpException
     */
    public function actionAjaxUpload($gallery_id = null)
    {
        $model = new GalleryPhoto();
        $model->gallery_id = $gallery_id;
        $imageFile = CUploadedFile::getInstanceByName('image');
        $model->file_name = $imageFile->getName();
        $model->save();

        $model->setImage($imageFile->getTempName());
        header("Content-Type: application/json");
        echo CJSON::encode(
            array(
                'id' => $model->id,
                'rank' => $model->rank,
                'name' => (string)$model->name,
                'description' => (string)$model->description,
                'preview' => $model->getPreview(),
            ));
    }


Is the image stored on the server folder under gallery folder?

I checked that the image name is stored in the gallery_photo table but when I checked the gallery folder I see images but they are with different name..
Any idea how to save the images using your extension onto a specific directory in the server?
0

#125 User is offline   Bogdan Savluk 

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

Posted 15 September 2014 - 04:42 AM

View PostSachy, on 14 September 2014 - 10:11 AM, said:

Is the image stored on the server folder under gallery folder?

I checked that the image name is stored in the gallery_photo table but when I checked the gallery folder I see images but they are with different name..


Image name
$model->file_name

is stored only for purpose of tracking uploaded filenames... it is not used to generate file name on the server or somewhere else...

Actual image is saved there:
$model->setImage($imageFile->getTempName());


Using id from gallery_photo.

Any idea how to save the images using your extension onto a specific directory in the server?


What exactly you want to do? In general you will need to modify extension.
0

#126 User is offline   VERSHA 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 01-September 14

Posted 28 October 2014 - 05:12 AM

Hello ,


I have read all the instruction steps but still i am unable to understand it please help me how to use this extention as i want to give functionality to create and add gallery imgaes . I am soory for being foolish but still i need to apply this extenion . Urgern :(
I dont understand what do you men by this
1.Checkout source code to your project, for example to ext.galleryManager.
2.Install and configure image component
5.Add GalleryController to application or module controllerMap.
6.Configure and save gallery model

regards,
versha
0

#127 User is offline   EndErr 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 18
  • Joined: 05-June 12

Posted 18 November 2014 - 09:14 AM

Юзал галерею для Yii 1, для Yii2 будет?
0

#128 User is offline   Miranitha Fasha 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 29-October 12

Posted 08 January 2015 - 09:40 PM

Excuse Me, Sir.
i have any question. for image component extension tar gz after extract, where the folder was placed and what the folder name ?? . Thanks
0

#129 User is offline   Miranitha Fasha 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 29-October 12

Posted 08 January 2015 - 11:20 PM

Excuse Me, Sir. I have tried the steps that have been given, but when it will be uploaded there was an error. how to handle it ? Help me, please. Thanks

Attached File(s)


0

#130 User is offline   Bogdan Savluk 

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

Posted 18 March 2015 - 03:17 PM

Just finished porting to Yii2.

It is almost ready for use:
https://github.com/z...gallery-manager
0

Share this topic:


  • (7 Pages)
  • +
  • « First
  • 5
  • 6
  • 7
  • You cannot start a new topic
  • You cannot reply to this topic

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