Jump to content
Soma

Images Manager (beta)

Recommended Posts

Great work Soma, thanks for the effort.

Wouldn't it be more consistent to use the widely known Wordpress short code syntax (http://codex.wordpress.org/Shortcode_API)?

[image='/path/imagename/' width='100' class='align_left']

And since there's also already a short code module for PW ... or is there a reason why choosing your syntax over the other?

Keep it up!

Share this post


Link to post
Share on other sites

Hi Soma, only want to drop a short note:

when working with the ImagesManager in a MultiLanguageSite and the current AdminUser has another Language than the default one

when creating new CategoryPages the PageTitle is only set for the current UserLanguage, default-LanguageTitle is left empty!

With PageName, you populate all LanguageFields with the CategoryName. With the TitleField I think the defaultLanguage should be filled too, because it is the fallback for other empty TitleFields.

PS: it's really fun to work with the ImagesManager! :)

Share this post


Link to post
Share on other sites

Great work Soma, thanks for the effort.

Wouldn't it be more consistent to use the widely known Wordpress short code syntax (http://codex.wordpress.org/Shortcode_API)?

[image='/path/imagename/' width='100' class='align_left']

And since there's also already a short code module for PW ... or is there a reason why choosing your syntax over the other?

Keep it up!

I don't know shortcodes and WP anyway and don't know if it's a good idea.

Shortcode module is something different.

I've chosen PW selectors because it works well and is easy to use.

Hi Soma, only want to drop a short note:

when working with the ImagesManager in a MultiLanguageSite and the current AdminUser has another Language than the default one

when creating new CategoryPages the PageTitle is only set for the current UserLanguage, default-LanguageTitle is left empty!

With PageName, you populate all LanguageFields with the CategoryName. With the TitleField I think the defaultLanguage should be filled too, because it is the fallback for other empty TitleFields.

PS: it's really fun to work with the ImagesManager! :)

Yeah I noticed this too and couldn't made up my mind to how it should behave with multilanguage. I will have a try soon, thanks.

Share this post


Link to post
Share on other sites
Great Job, Soma! An image management tool was at the top of my personal wish list. Your module comes close to this desired. It is a promising alpha version ...

However, I have a problem with uploading images. Error message: Class 'PageImage' not found (line 526 of /../site/modules/ImagesManager/ImagesManager.module) In the ImagesManager is a new line with title, category, imagetag, modified and a broken image icon. The file is uploaded to the directory tmp_uploads, the corresponding page in the selected category created. But the picture file does not move in the new asset subdirectory. Did I forget something during installation?

In addition, only the administrator can use the ImagesManager. Other users will only see the button on textarea fields. But has no function.

In the module-config I have entered two special fields under "Textfields used for searching images on pages". However, the button ImagesManager will appear above each textarea field.

Can you help me to make better use the module? 

Thanks.

Share this post


Link to post
Share on other sites

Thanks enibas94 for the feedback and using my module.

There's a permission for the module "images-manager". You can create a new permission with that name and give it to roles that should see ImagesManager page.

There's currently no permission or access handling for the button added to all textarea fields. The "Textfields used for searching images on pages" is originally meant for the module to search for if there's images in the text. But kinda would be the same fields as where to add the ImagesManager button. So while already there, I changed the config to say "Textarea fields you want to use the ImagesManager on."

So it is now used to define what textarea fields you want to use ImagesManager. This is now working for editor users.

As for your error.  Error message: Class 'PageImage' not found (line 526 of /../site/modules/ImagesManager/ImagesManager.module)

Not sure but since the class name is "Pageimage" I guess it has to do with PHP version, because it works for me, but maybe the capital "I" in PageImage is making it not find the class on your environment. 

I changed it to "Pageimage" and committed an update.

Can you let us know if it's working for you now?

Share this post


Link to post
Share on other sites

Hi Soma, thank you for the quick help. Now the upload works for me! Small cause, large effect.

I have also added the permission. Now the editors can feed the ImagesManager. But the button ImagesManager above the text boxes still does not work for these users. The other with the text boxes "used for searching images on pages" I still do not quite understand it. But it will come ... I'm sure.

Share this post


Link to post
Share on other sites

It is working fine, make sure you updated the module with all its files correctly. 

The setting in the ModulesManager you talk about is now called:

Textarea fields you want to use the ImagesManager. A button will appear above those fields.

Add one or more fields separated by a pipe body|sidebar.

Share this post


Link to post
Share on other sites

I just made another update to replace the fields settings with a AsmMultipleSelect for convenience. If you update, you want to select the textarea fields you want to use IM on. You also have to save the module setting at least once to make it work. And maybe reinstall the module to get rid of unnused settings, but not necessary.

post-100-0-42784600-1372755454_thumb.png

  • Like 4

Share this post


Link to post
Share on other sites

Soma, since you pointed me to it specifically, I just wanted to let you know that I was able to use ImagesManager for my project and it fit the bill completely. Thanks for taking the time to work on image gallery management for PW!

  • Like 4

Share this post


Link to post
Share on other sites

Hello,

I just tried your module in a fresh PW install following the steps you outlined in the first post. 

Everytime I try to upload a image I get these two errors:

  • pme_power_foto.jpg - Invalid file extension, please use one of:

  • Missing required value (ImagesUpload)

Any idea what's wrong?

Share this post


Link to post
Share on other sites

No sorry, I have no idea currently. Any more hints to how you set up or reproduce?

Where do you get these errors? 

Invalid file extension, please use one of: ....  (one of what?)

Are the file extensions set correctly for the image field?

Missing required value, means there's no image sent... ?

Share this post


Link to post
Share on other sites

There is one thing I did not mention... I'm using a fresh install but with the Bootstrap profile.

I tried this setup again with the default site and everything is working fine.

Thanks for your help.

Share this post


Link to post
Share on other sites

Hi Soma,

THANKS for this module! ^_^

Is this still true?:

Use at your own risk and it's not recommended to use in production yet.

I have a site about to go into production (I'm about to upgrade it from 2.3 to 2.4 too before it goes live). Would you recommend I not use ImagesManager due to it's Alpha status?

I know if I use it it is at my own risk no matter if you say yes or no :)

Share this post


Link to post
Share on other sites

To be honest, I'm not sure. Yes it's alpha/proof of concept but seems pretty stable and some use it already. But it also means it didn't get any love since then.

I don't think there can happen much as it just creates pages with a image on it. So even you could go and do it without/remove ImagesManager. The parsing part for image tags could also be replaced or handled differently. It's all not things that can break easily or go competly wrong you wouldn't be able to fix somehow.

  • Like 1

Share this post


Link to post
Share on other sites

Thanks Soma, I understand completely, it's a 'nice' Module that is not invasive and as you note should it break for some reason I would be able to work-around that with normal PW code and small changes.

Thanks for your fast and helpful comment :)

Share this post


Link to post
Share on other sites

Images Manager is a fantastic and very useful module that I install on every ProcessWire site.  I have a couple of sites on 2.4 and haven't experienced any problems.

  • Like 2

Share this post


Link to post
Share on other sites

FAB! Thanks for the experience and advice cstevensjr :)

Share this post


Link to post
Share on other sites

Hey Soma. Very useful module and it has promise to be just what I need for something I'm working on right now but I have a couple of questions:

First, I need to upload images of a higher resolution but when I upload through the module interface I get an error that the file exceeds the maxFilesize set in the php.ini. The php.ini maxFilesize is set to 10mb and the pics, so far, have been well below that. When I use the standard pw image upload the files go up no problem but error out using the module. I notice you set a maxFilesize => 32 default but when I change that it doesn't make any difference. Can you give me some guidance how to set it to match the limit in the server php.ini? Also it might be worth considering adding an option in the module settings to set the maxFilesize.

Second, I sometimes forget to set the category before clicking upload and I found that rather than throw an error immediately, the module goes through the process of uploading the file first, then throws the error that no category was set. Since the file's already uploaded, it get's left orphaned in the temp directory. I went into the assets > files > .tmp_uploads and found several pics from days earlier still in there. I can't be the only one that sometimes forgets to set a category which means the server could get clogged with orphaned files pretty quickly. Maybe an onsubmit check for the category before upload begins would fix that.

Share this post


Link to post
Share on other sites

Have a read of this: https://processwire.com/talk/topic/2194-flie-upload-max-file-size/

It should help you with your php.ini settings.

Thanks Adrian but if the server php.ini was the problem then any image I upload whether using the images manager module or using the images field that exceeds the limit would fail. Wouldn't it? If I go to a page and use the images field to select and upload a 2mb or 3mb image is succeeds but not through this module.

I'm making the assumption it's not the server's php.ini.

Share this post


Link to post
Share on other sites

I had a similar problem early this morning.  I was trying to upload an image to Images Manager and it would not work.  

post-756-0-09568100-1399312886_thumb.png

This was using the latest version of PW Dev.  I struggled with this for a few hours and then reverted my /wire directory to 2.3.12 and then everything worked again (I could upload images).  A few minutes ago I uploaded version 2.4.1 and it also worked.

I opened an issue on this occurrence in Github.  

Edited by cstevensjr
  • Like 1

Share this post


Link to post
Share on other sites

I had a similar problem early this morning.  I was trying to upload an image to Images Manager and it would not work.  

attachicon.gifpw-latest-dev.png

This was using the latest version of PW Dev.  I struggled with this for a few hours and then reverted my /wire directory to 2.3.12 and then everything worked again (I could upload images).  A few minutes ago I uploaded version 2.4.1 and it also worked.

Where did you get 2.4.1? The latest version I can find is 2.4.0.

Share this post


Link to post
Share on other sites

@digitex, ImagesManager doesn't set a maxFilesize, where do you see this? It uses PW InputfieldFile.module that does set it from the php.ini. I'm not sure in what regard it is different to when uploading on a page, because it should be the same. Though the upload form in ImagesManager is a normal form file input that uploads on submit, while page upload you may using ajax async upload. Anyway it shouldn't make a difference.

Thanks for the suggestion with the missing category parent. Yes, that surely would be possible. While it all works somehow, there's a lot left to be desired. It's still an proof of concept pretty much.

@cstevenjr, are getting this on a new install? I haven't tried yet on latest PW though. Strange. 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By eelkenet
      Hi! I've created a small Inputfield module called InputfieldFloatRange which allows you to use an HTML5 <input type="range" ../> slider as an InputField. I needed something like this for a project where the client needs to be able to tweak this value more based on 'a feeling' than just entering a boring old number. Maybe more people can use this so I'm hereby releasing it into the wild.  
       
      What is it?
      The missing range slider Inputfield for Processwire. 
      What does it do?
      This module extends InputfieldFloat and allows you to use HTML5 range sliders for number fields in your templates.
      It includes a visible and editable value field, to override/tweak the value if required.  
      Features
      Min/max values Precision (number of decimals) Steps (Read more) Manual override of the selected value (will still adhere to the rules above) Usage
      Clone / zip repo Install FieldtypeFloatRange, this automatically installs the Inputfield Create new field of type `Float (range)` or convert an existing `Float`, `Integer` or `Text` field. To render the field's value simply echo `$page->field` Demo
      A field with Min=0, Max=1, Step=0.2, Precision=2

      Field with settings Min=0, Max=200, Step=0.25, Precision=2

       
      Todo
      Make the display-field's size configurable (will use the Input Size field setting)  Hopefully become redundant If it's usable for others I'll add it to the Modules list  
      Changelog
      v002
      - Fix issue where setting the step value to an empty value created problem with validation
      - Make the display-field optional 
      v001
      - Initial release
       
      Thanks!
       
       
    • By Robin S
      Another little admin helper module...
      Template Field Widths
      Adds a "Field widths" field to Edit Template that allows you to quickly set the widths of inputfields in the template.

      Why?
      When setting up a new template or trying out different field layouts I find it a bit slow and tedious to have to open each field individually in a modal just to set the width. This module speeds up the process.
      Installation
      Install the Template Field Widths module.
      Config options
      You can set the default presentation of the "Field widths" field to collapsed or open. Field widths entered into the Template Field Widths inputfield are only applied if the Edit Template form is submitted with the Template Field Widths inputfield in an opened state. "Collapsed" is the recommended setting if you think you might also use core inputs for setting field widths in a template context. You can choose Name or Label as the primary identifier shown for the field. The unchosen alternative will become the title attribute shown on hover. You can choose to show the original field width next to the template context field width.  
      https://github.com/Toutouwai/TemplateFieldWidths
      https://modules.processwire.com/modules/template-field-widths/
    • By adrian
      Tracy Debugger for ProcessWire
      The ultimate “swiss army knife” debugging and development tool for the ProcessWire CMF/CMS

       
      Integrates and extends Nette's Tracy debugging tool and adds 35+ custom tools designed for effective ProcessWire debugging and lightning fast development
      The most comprehensive set of instructions and examples is available at: https://adrianbj.github.io/TracyDebugger
      Modules Directory: http://modules.processwire.com/modules/tracy-debugger/
      Github: https://github.com/adrianbj/TracyDebugger
      A big thanks to @tpr for introducing me to Tracy and for the idea for this module and for significant feedback, testing, and feature suggestions.
    • By adrian
      This module allows you to automatically rename file (including image) uploads according to a configurable format
      This module lets you define as many rules as you need to determine how uploaded files will be named and you can have different rules for different pages, templates, fields, and file extensions, or one rule for all uploads. Renaming works for files uploaded via the admin interface and also via the API, including images added from remote URLs.   Github: https://github.com/adrianbj/CustomUploadNames
      Modules Directory: http://modules.processwire.com/modules/process-custom-upload-names/
      Renaming Rules
      The module config allows you to set an unlimited number of Rename Rules. You can define rules to specific fields, templates, pages, and file extensions. If a rule option is left blank, the rule with be applied to all fields/templates/pages/extensions. Leave Filename Format blank to prevent renaming for a specific field/template/page combo, overriding a more general rule. Rules are processed in order, so put more specific rules before more general ones. You can drag to change the order of rules as needed. The following variables can be used in the filename format: $page, $template, $field, and $file. For some of these (eg. $field->description), if they haven't been filled out and saved prior to uploading the image, renaming won't occur on upload, but will happen on page save (could be an issue if image has already been inserted into RTE/HTML field before page save). Some examples: $page->title mysite-{$template->name}-images $field->label $file->description {$page->name}-{$file->filesize}-kb prefix-[Y-m-d_H-i-s]-suffix (anything inside square brackets is is considered to be a PHP date format for the current date/time) randstring[n] (where n is the number of characters you want in the string) ### (custom number mask, eg. 001 if more than one image with same name on a page. This is an enhanced version of the automatic addition of numbers if required) If 'Rename on Save' is checked files will be renamed again each time a page is saved (admin or front-end via API). WARNING: this setting will break any direct links to the old filename, which is particularly relevant for images inserted into RTE/HTML fields. The Filename Format can be defined using plain text and PW $page variable, for example: mysite-{$page->path} You can preserve the uploaded filename for certain rules. This will allow you to set a general renaming rule for your entire site, but then add a rule for a specific page/template/field that does not rename the uploaded file. Just simply build the rule, but leave the Filename Format field empty. You can specify an optional character limit (to nearest whole word) for the length of the filename - useful if you are using $page->path, $path->name etc and have very long page names - eg. news articles, publication titles etc. NOTE - if you are using ProcessWire's webp features, be sure to use the useSrcExt because if you have jpg and png files on the same page and your rename rules result in the same name, you need to maintain the src extension so they are kept as separate files.
      $config->webpOptions = array(     'useSrcExt' => false, // Use source file extension in webp filename? (file.jpg.webp rather than file.webp) ); Acknowledgments
      The module config settings make use of code from Pete's EmailToPage module and the renaming function is based on this code from Ryan: http://processwire.com/talk/topic/3299-ability-to-define-convention-for-image-and-file-upload-names/?p=32623 (also see this post for his thoughts on file renaming and why it is the lazy way out - worth a read before deciding to use this module). 
       
       
      NOTE:
      This should not be needed on most sites, but I work with lots of sites that host PDFs and photos/vectors that are available for download and I have always renamed the files on upload because clients will often upload files with horrible meaningless filenames like:
      Final ReportV6 web version for John Feb 23.PDF

×
×
  • Create New...