OLSA

Members
  • Content count

    91
  • Joined

  • Last visited

Community Reputation

52 Excellent

About OLSA

  • Rank
    Full Member

Profile Information

  • Gender
    Male

Recent Profile Visitors

2,418 profile views
  1. If inside page field setup is checked "Allow new pages to be created from field", there is option to create new page in modal window using hook method inside "site/ready.php". Please note to write page field name inside if statement. // ready.php $this->addHookAfter('InputfieldPage::renderAddable', function ($event){ $inputfield = $event->object; // please note: inside if statement need to write page field name! if ($inputfield->name == 'your_page_field_name') //<= here { $link = $this->wire('config')->urls->admin . 'page/add/?parent_id=' . $inputfield->parent_id . '&modal=1'; $out = '<p><a href="' . $link . '" target="_blank" class="pw-modal pw-modal-large"> <i class="fa fa-plus-circle"></i> Create New</a></p>'; $event->return = $out; return $event->return; } }); Regards.
  2. Can you try to change url (without "-" separator) ajax: { url: './option1list/', dataSrc: '' },
  3. OLSA

    If someone is interested, here is example how to automatically assign icon to file depends on file type. No images or empty HTML tags "<i class="fa..."></i>", only CSS pseudo elements. Link to Codepen Regards.
  4. OLSA

    Hello Matthew, the same things happened to me few times on PW 3.0.xx, this is not some help, only few facts what I noticed. I rember that I had some errors in session logs (did not investigate). What works in my case was to use shortcut to edit pages from front-end ("go to back-end from front-end" and admin page tree problem disappear). Also you can try, logout, CTRL+F5 (clear browser cache), and login again. Regards.
  5. Thank you Pwired, but please note that I mostly posted here working/devs versions (to minimise websites promotions). They are mostly from template selling portals where client buy template (html, wp, joomla... what they likes), and after it my job is full conversion to PW. At the end, many of these templates in source has large part of unused CSS, and because of that, in last step, I like to do and css optimisation/cleaning (eg. using node.js + grunt-uncss). Regards.
  6. Hello, here are some examples, all is Processwire, and all is conversion from HTML to PW. bistro, lawyer, mtrace, nekretnine, registar, prteam, entext... If you are interested, feel free to contact me. sasaoluic (AT) yahoo (DOT) com Best regards.
  7. OLSA

    Hello, also the same problem (ProcessWire 3.0.98 ), and solved it with this script. Maybe it looks dangerous (overwriting translation files) but it's solve my problem. /* This script iterate over json translation files and replace 'file' path separator to "\/". If you want to try it - place it in some template and reload page with that template. After fix, delete this script. */ foreach($languages as $language){ $path = $config->paths->files . $language->id; $files = preg_grep('~\.(json)$~', scandir($path)); if( count($files) ){ foreach($files as $file){ // file path $file_path = $path . DIRECTORY_SEPARATOR . $file; // load file $contents = file_get_contents($file_path); // decode JSON data into a PHP array $contentsDecoded = json_decode($contents, true); if (strpos($contentsDecoded['file'], '\\') !== false) { $contentsDecoded['file'] = str_replace('\\', '/', $contentsDecoded['file']); // encode array back into a JSON string and prettify $json = json_encode($contentsDecoded, JSON_PRETTY_PRINT); // save file file_put_contents($file_path, $json); } } } } Regards.
  8. @cstevensjr thanks for the reply. I found that links before, but read to fast..., now understand that is still in development/testing phase. Before 2 years I build JSON fieldtype (for configuration only), but sometimes, I use it to store contact details. Because never totally finished, I didn't post it to module section. Please, allow me to suggest that in case of this new fieldtypes (FieldsetGroup and FieldsetPage), to try to find another one option for multilanguage tabs to reduce space in user interface (and to get some kind of "compact view"). To be more clear, here are some screenshots of my JSON configuration filedtype. Compact view/layout: Field settings: Thanks for Ryan and others who are involved in development of this new fieldtypes. Best regards.
  9. Hello, is FieldsetGroup included only inside Pro fields or it in core? I am asking this because I had updated from 2.8 to 3.098 and can't find option to create FieldsetGroup field type? Thanks and regards.
  10. OLSA

    Thank you Ryan for focus point feature. Before this, I used option with select field where editor define focus point (crop from top percentages) - but right now it would be more precious and editors will like it more! Thanks.
  11. OLSA

    In my last project I had a to import about 4000 images, and had problem with about 1200 images. Images uploaded (using API from frontend), but some of them doesn't had variations images. Problem was that PHP GD image resize engine is very strict, and if there is any problem with image (beginning and ending bytes of file) GD resize failed. More about my case and solution is here.
  12. OLSA

    Hello BitPoet and others, don't know if this can help, but before few days in one project I need some solution to store repeatable urls, and build fieldtype "Repeats". It is very simple repeatable input (varchar/text) field (one of custom fields created thanks to Ryan Events module). I am sure that for you wouldn't be a problem to copy/paste/rename and create integer/float repeatable field. I had build many PW fields types but never had enough time to polish it and place in PW modules section. Regards. FieldtypeRepeats.zip EDIT: I read this topic again, and because these days I am mostly in "backend forms job", my first thought was that you need this for backend forms. Sorry for that. Please note - this field type is not for front-end forms - it is for backend/admin forms. Also, here is example how to get field values at front-end. // my first plan was to store few "link" details // because of that, need to call "value" // default foreach($page->field_name as $url){ echo $url->value;// note: "value" } // to get first row echo $page->field_name->first->value;
  13. Hello. There are few possible problems with centralised concept. As example, what to store in that images field? To be more clear, if some image is part of PW page only as reference link, than how can we resize it (eg. "on the fly" in page rendering process)? What would happened when someone delete image on that external point - how would ProcessWire page know that? Etc... Because of that, if I go to build that module/field type than probably it will copy image from that external central point to ProcessWire page. With that, we can have external Media manager where we can use all it's power (organise files to folders, search etc.). Also, because we have on PW side copy of that file we can use all PW API power to manipulate with it - on PW side. Here was few discussions why PW by default doesn't have "Media manager" like many others CMS's (I was one with that question too) but very soon undrestand that maybe because of that some other popular CMS's still doesn't have simple solution to store and generate various dimensions intro images. If some CMS's had that option, need to look closely to see how and where they store eg. that intro images... Storing concept is very important (eg. in case when need to do some export or imports). That what you ask is completly ok, but also it's important to think about possible consequences. What I like in centralised Media manager idea is 1 central point for file organisations, all other with that idea bring us problems and complicate things. Regards.
  14. OLSA

    After all, write small function to locally test resizing of images (using default PHP GD image library) and find that this images are not 100% valid (semi corrupted jpeg files). Strange thing was, as you can see here (first two images) looks normal. Same PW on Windows with PHP >=7.1.9 works fine - no problems with upload and resize. Inside PW logs, Tracy debugger, Wamp/PHP logs, custom core debugging, didn't find any exception/note about "Corrupt JPEG data" (maybe because error suppression operator (@) in few places inside image processing/pw core). Also playing locally with PHP getimagesize() return correct image data (size, bit, channels, mime...) for all that images . Etc... If you ever had a problem with upload/resize images, and on server use PHP GD enginee, and images looks ok, maybe there is a problem with small file corruption. In that case you can try to put this in site/config.php ini_set("gd.jpeg_ignore_warning", 1); This will not fix corrupted jpeg image, but will provide that PW image processing do job and doesn't break. Regards.
  15. Hello for all. I have strange problem with images in PW 3.0.62, wamp, PHP 5.6 - 7.0.23, (Windows 10, i5, 8GB RAM). 1. Can't upload some images, process failed in first step (thumbnail preview creation). 2. Images can be uploaded/saved using API, but later in admin backend, there is no preview thumbnail image. It can be opened and zoom, but can't edit/crop/resize . 3. Everything works fine in PHP 7.1.9 Warning and errors: "Warning: filesize(): stat failed for .../site/assets/files/image-name.jpg in ...\wire\core\Pageimage.php on line 511" "ImageSizer::resize(0, 260) failed" "ProcessPageEditImageSelect: Unable to complete resize" I have large number of images with that problem in current project, and if someone want to test this, I attached two "bad" images, and screenshot from admin backend. Don't know is this some kind of ProcessWire issue or there is some problem with images? Please, what is yours opinion about this? Thanks.