Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

19 Good

1 Follower

About iipa

  • Rank
    Jr. Member

Recent Profile Visitors

528 profile views
  1. Somehow I didn't consider this option at all! Thanks @dragan, I decided to implement this with cookies 🙂 And thanks to you too @horst, I'm sure this will come handy at some point!
  2. Hello forum! I have a site, where I want to remember two settings defined by user: 1) Theme (light or dark) 2) Language (Finnish or English) Because user makes changes to these settings on client side, I am a bit lost with how can I save them in ProcessWire $session variable? I would like to use $session for more reliable saving, and since it is only two variables I will use, I doubt it will become too resource-needy. I have tried using jQuery's post() -method referring to a file in Templates folder (theme.php), but I get 403 Forbidden Error. I don't like the idea of tryi
  3. Actually I came to a pretty handy solution with my co-dev! Images have information about their modification time saved within them, so using that I came up with following code: $img = $page->image; // check if image exists if($img) { // fetch cropped images' modification timestamps $tsNormal = filemtime($img->getCrop('normaali')->filename); $tsHigh = filemtime($img->getCrop('korkeampi')->filename); $tsLow = filemtime($img->getCrop('matalampi')->filename); // check if they have the same modification time => user hasn't cropped the image, so use the orig
  4. Yes, there will always be default crops. Problem is that I don't need to use all of them, just one. I'll try to explain better: 1. User uploads an image. 2. If user thinks the image is good as it is, render the uncropped version. 3. If user wants to crop the image, user selects which crop setting they want to use, and then render that crop version. Problem is how can I detect which version should I use? I can't check if a version exists, since they always do.
  5. Couple of other questions though: 1. If I have multiple cropping options (normal, higher, lower height), how can I easily control which crop setting should be used? Since it does all crops when uploading the image, I can't simply check if a crop version exists. Also what if I want to use the original image instead of crop versions, how can I select that? 2. Translation file lacks a few fields from the modal: "ESC" and cropped image parameters (imgUrl, suffix, width x height, quality, sharpening). Also cropped image modal title "Save" can't be translated. Otherwise great module!
  6. Yes, issue is gone now 🙂
  7. Hi! I have an issue when I upload an image into the field. This is one of the log messages ("matalampi" is the crop setting😞 /../site/assets/files/1328/testiimagenodashes-1.-matalampi.0x48.jpg - Unable to copy /../site/assets/files/1328/testiimagenodashes-1.-matalampi.jpg => /../site/assets/cache/WireTempDir/.PFM0.06231100T1568804893RIbnRkmpEmZApFan/0/testiimagenodashes-1.-matalampi.0x48.jpg Same error comes from all variations. Apparently the field tries to create file variations from the image immediately after upload, but for some reason it doesn't work and a corrupted f
  8. Hi fellow developers! I have a basic image field on my page. I would like to force a specific aspect ratio when user wants to crop the image. Module apparently uses crop.js for cropping features, and I found some settings related to it in ProcessPageEditImageSelect.js: var cropSettings = { autoCrop: true, autoCropArea: 0.35, zoomable: false, rotatable: false, // etc ... }; I would like to change these settings, but obviously I don't want to do so straight in module code (especially because it is in wire). Question is: How can I refer to these settings somew
  9. Oon some browser+OS combos that button does not work, unfortunately. I actually have debug on, since we haven't launched yet, but I'm also starting to lean into problem being in server side configurations. I managed to accomplish this in CKEditor's config.js by adding config.disallowedContent = '*{*}'; which does it automatically when pasting. It was also enough to keep server happy aswell!
  10. Well that's propably why, since I have 3.0.123! Thanks @dragan, sometimes the simplest things to check just don't come to mind 😄
  11. I have a CKEditor Textarea in a page template. Some users like to add text in them by pasting from Word document. This leads to internal server error when saving page. When using paste without formatting (cmd + shift + V), page is saved normally, so I assume error has something to do with Word's hidden characters that cause issues in many other programs as well. (I don't have Word myself, so I debugged this with video chat with user. I forgot to ask to check code view, so I'm not sure if they are visible there.) Is there a way in ProcessWire/PHP to sanitize Textarea input from these hidde
  12. Hi @Robin S! I'm a bit confused with your solution. I tried to use your code, it threw me "Uncaught Error: Undefined class constant 'statusFlagged'". I looked at wire/Page.php, and it doesn't seem to have statusFlagged: static protected $statuses = array( 'locked' => self::statusLocked, 'systemID' => self::statusSystemID, 'system' => self::statusSystem, 'draft' => self::statusDraft, 'versions' => self::statusVersions, 'temp' => self::statusTemp, 'hidden' => self::statusHidden, 'unpublished' => self::statusUnpublished, 'trash' => self::stat
  13. Thanks @Edison, that was what I was asking 🙂 Although @elabx and @dragan have good points: Composer usage might be pretty handy, and good to learn. I installed Composer, include_once() with correct path, but class cannot be found. Should I also put use [namespace]?
  14. What do you mean with "just get it from Github"? How do I refer to it from ProcessWire?
  15. Hi fellow developers! I want to implement following action: Admin-priviledged user uploads a spreadsheet file (with many sheets) When page is saved, back end generates repeater items from the sheets We can render spreadsheet data from the repeater field. Profit! Currently I'm trying to find a way to read the uploaded spreadsheet file. ProcessWire doesn't seem to have modules suitable for my needs, but external PHP Library PhpSpreadsheet sounds like it could do the job. However, I can't even try it, because I simply don't understand how I can refer to an external libr
  • Create New...