Jump to:

10992 Posts in 2727 Topics by 1818 members

All other Modules

SilverStripe Forums » All other Modules » Pixlr Image Editor: How to make it work?

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1 2
Go to End
Author Topic: 3598 Views
  • patjnr
    Avatar
    Community Member
    101 Posts

    Pixlr Image Editor: How to make it work? Link to this post

    Hi

    Pixlr Module

    According to its writer (Marcus), this module is suppose to automatically add a button to the Image insertion panel to add new images via Pixlr, and add a button to the any images in your File and Images section to edit the image.

    I have been trying to use this Module, which is available here .
    After renaming the module folder to pixlr, i got it partially working on under Files & Images and I could see the Edit This Image button as I was suppose to.

    In the CMS after adding this

       public function getCMSFields()   {
          $f = parent::getCMSFields();
          $f->addFieldToTab("Root.Content.Image", new ImageField("Image"));
          return $f;
       }

    I didnt see the Edit This Button.

    Also on a website that has DOM installed, under Files & Images, nothing comes up.

    thank you

    PJ

  • Marcus
    Avatar
    Administrator
    86 Posts

    Re: Pixlr Image Editor: How to make it work? Link to this post

    The "Add" button is available when you click the "Insert Image" action in the WYSIWYG editor for a content block

    (image changed to URL for page breaking!)

    http://github.com/nyeholt/silverstripe-pixlr/raw/master/docs/add-image.png

    Unfortunately it looks like DOM makes some changes to the structure of form within image popups, meaning certain tabs aren't available as usual. I'll have to look into whether this needs to be handled specifically or not; normally, it should appear as per below

  • DsX
    Avatar
    Community Member
    178 Posts

    Re: Pixlr Image Editor: How to make it work? Link to this post

    I am very interested in see it work with DOM as I am sure many others are.

  • Marcus
    Avatar
    Administrator
    86 Posts

    Re: Pixlr Image Editor: How to make it work? Link to this post

    I have just made a commit that works around some of the issues to make it work better with DOM. One thing though is that DOM needs to be patched to allow the custom asset manager load up appropriate popups depending on what the type of the file actually is (instead of it being hardcoded to File).

    I've attached the .diff for dataobject_manager below; you can apply it by running

    patch -p0 < /path/to/file.diff

    when you're in the top level of your SilverStripe directory. Alternately, the PHP file is attached too. I'll try and get in touch with Uncle Cheese to see whether he wants these added to the module.

  • patjnr
    Avatar
    Community Member
    101 Posts

    Re: Pixlr Image Editor: How to make it work? Link to this post

    Hi

    To save time dumped the new AssetsManager in DOM and here is the thing ..

    if you have DOM installed, first you have to add these lines in the _config.php

    DataObjectManager::allow_assets_override(false);
    DataObjectManager::allow_css_override(false);

    otherwise you will get this error
    [User Error] FieldSet::addFieldToTab() Tried to add a tab to object 'FieldSet' - 'BottomRoot' didn't exist.

    The other problem is if you are viewing the image inside a pop_up, everything will be bundled inside that small pop_up.

    It would be nice have the edit button on every ImageField. Does this Work?

    $f->addFieldToTab("Root.Content.Image", new ImageField("Image"));

    Also why can it replace the cropped Image on save or maybe ask to replace or create a new one. Otherwise the assets folder is going to be multiplied by 2 (cropped and raw image).

    thx

    PAt

  • Marcus
    Avatar
    Administrator
    86 Posts

    Re: Pixlr Image Editor: How to make it work? Link to this post

    That's a good idea having it directly on ImageField controls - I've added it to the github tracker.

  • hp777
    Avatar
    Community Member
    10 Posts

    Re: Pixlr Image Editor: How to make it work? Link to this post

    Hi Marcus
    I made the changes from the files above but I'm getting this error any Idea? Think its a typo or quoting issue but I can't find it.

    Failed to load resource: the server responded with a status of 500 (Warning: "RegexIterator::__construct() [<a href='regexiterator.--construct'>regexiterator.--construct</a>]: Compilation failed: unrecognized character after (?&lt; at offset 3" at line 110 of /++++/www/vhosts/++++++.com/http/pixlr/code/decorators/PixlrImageDecorator.php)

  • Marcus
    Avatar
    Administrator
    86 Posts

    Re: Pixlr Image Editor: How to make it work? Link to this post

    What version of PHP are you using? I have a feeling it's a small incompatibility with the regex being used on older versions of PHP5

    3598 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.