Jump to content

horst

PW-Moderators
  • Posts

    4,088
  • Joined

  • Last visited

  • Days Won

    88

Everything posted by horst

  1. no worry, updating this way is fine. only changing the wire folder is enough.
  2. sorting descendend, and not ascendend?
  3. The error says, that you finally have no pageimage object in $neuigkeit->images->first() So, at first you need to check / debug what is in $neuigkeit, what is in $neuigkeit->images and if there are images available in the field on the current page. Your field setup looks good! incl. setup for cropsetting. Calling it looks good too, but something in your chain isn't what it should be: $neuigkeiten should be a page (with a template and with fields). Please check this in your code at exactly the point that throws the error: echo "<pre>\n<hr />"; echo "$neuigkeiten->id \n $neuigkeiten->template->name \n"; // if the above is not id == 0 and has a valid template name, go on and check the fields in that page: foreach($neuigkeiten->feilds as $f) { echo "$f->name \n"; // if the images field is in, check if it has images available if('images' == $f->name) { echo " count: " . count($neuigkeiten->images) . "\n"; } } // if all above is ok, at list the ->first() image should be a pageimage, you can check this too $testobj = $neuigkeit->images->first(); if(is_object($testobj)) { echo $testobj->className() . "\n"; } echo "\n<hr /></pre>\n";
  4. ui, thanks! Corrected!
  5. A small site relaunched for a cultural sponsorship association: Freundeskreis Ludwiggalerie
  6. Please, what's your question? Probably you haven't installed a new PW 3, but copied a PW3 wire folder over a previous PW2 wire folder? If not, can you provide the exact steps what you have done?
  7. @Matcha The module installs a permission: "croppable-image-3". Have you given that to the roles that should be able to work with it?
  8. It should be working with the namespaced Version CroppableImage3. If it doesn't, you may strip out the namespace ProcessWire; at the top of all files, then install it with $config->debug = true; and look out for any failing function or class instance call that is prefixed with a backslash (\), if there are any of those errors or warnings, go into that file and line and remove the backslash (\). After that it will work. Other way would be to notify Ryan, that this module doesn't work with automaticly switching from v3.0 to v2.8 through the FileCompiler. Maybe he is willing to look at it and can justify the FileCompiler to identify and handle some special cases there too.
  9. Many thanks for the contribution. Does it work with PW 3, too?
  10. <shameless advertisement>I use PIA with $image->contain("size=200"); It respects upscaling and weighten too.</shameless advertisement>
  11. @lenoir Maybe, as a simple way, you also can add a select field near to the croppable image field and let the user select which format he want to be displayed on that page on the frontend.
  12. Hi lenoir, the designer / developer decides which format is displayed at the frontend, as he embedds the API code for the output into the template files. For example, if you define two formats (landscape and portrait), the user has the possibility to select the relevant crop section for both formats, but in a regular / simple setup, the output is defined in the template files with $image->getCrop("portrait")->url at places where a portrait image is required. If you want to give the user the possibility to choose from different formats for one single place, you need a special setup with e.g. pagetable or the ProFields Repeater Matrix wrapped around the image field.
  13. These subpages named home, etc, didn't they have a template called repeater_slider_repeater ? I'm not totally sure, but to a great extend, that the repeater items always have a template name with prefixed repeater_
  14. and how does the rendered markup look like?
  15. Ah, I think this is a bug, or at least it is not obvious for the user, how to define the template for a repeater. If you define a template, it checks if the current page has this template. I believe "home_final" is the template of the page that contains the repeater? The repeater item itself is a page too, but its template isn't "home_final". As a quick workaround: determine what is the template name of the repeater items and set this, (maybe additionally), into the fields setup. For example, if I have a repeaterfield named topmenu, I will find its items under Admin -> Repeaters -> topemnu -> ..., and their template is repeater_topmenu For the long term, i will see, if this can be done by the module behind the scences. But it will take some time that is currently not available for me.
  16. <?php // only render output if there is something set in field json_ld_alternateName if(strlen($page->json_ld_alternateName) > 0) { echo " <script type='application/ld+json'> 'alternateName: '{$page->json_ld_alternateName}', </script>\n"; } I wrap "doublequotes" around the php string and use 'singlequotes' for strings within the markup. If you run into situations where you also would need doublequotes within the markup, you can use them if you escape them with a backslash: <?php echo "<p>A string with 'singlequotes' and escaped \"doublequotes\"!</p>"; // will output: <p>A string with 'singlequotes' and escaped "doublequotes"!</p>
  17. Hi @Marty Walker, this seems to be new. So, just a shot into the blue: can you inspect settings in regard of adminThumb ($config->adminThumbOptions) in your site/config.php, and compare this with settings from the wire/config.php. Your site/config.php may have old settings from PW 2.7 that overwrites newer settings introduced with PW 3.0 to become unusable. (Maybe something that results in a thumb with 0 px height or width. If this doesn't help, it would be useful to see the markup (HTML-code) of that thumbnail.
  18. @adrian: Ok, your solution wasn't present when Antti wrote the legacy module. Is it right to assume that getting the " $inputFieldInstance at line 190" failes and it does an early return here? If so, and if it works for you and @ukyo this way, I will push this to the Github repo.
  19. @ukyo: have you changed back the first workaround, and then added this change as only one? Does this work and does it also create a crop variation just with or after the upload? Many thanks for your help here!
  20. @adrian: this is taken over from the old legacy thumbnail module. But, if I remember right, it is also present in core file and image modules. I need to test this.
  21. Maybe the setting is not relevant, but saving it one time before open the cropper modal? I need to test this.
  22. Do you have opened the FieldtypeCroppableImage3 config screen once or never after install?
  23. @adrian AH! Ok, that's what I have expected, but overseen. Sorry! @ukyo I don't think this is a real solution, because it should be able to create the crop and return a pageimage object. If you suppress the error so that it currently works for the upload, the crop will be created on the next request of getCrop(). But if there would be something other that fails, you wouldn't be informed and wouldn't get any crop variations. So this only can be a currrent workaround until @adrian has found the real issue. OT: @ukyo With that other issue you mentioned, it seems that you are the only one who has this. Please can you answer in the CroppableImage Thread my questions?
  24. Which PW version do you use? (namespaced or not) or simply try this: $p = new Processwire\PageArray(); // added namespace $editable_pages = wire("user")->editable_pages; // use wire() $branches = wire("pages")->find("template=branch"); // use wire() foreach($branches as $branch){ foreach ($editable_pages as $edit) { if($branch->id == $edit->id){ $p->add($branch); } } } return $p; please play around with and without added namespace, but let in the wire() calls.
  25. another thing: I haven't used the custom upload names module and thought to check if you have hooked before or after fileAdded Surprisingly, you hooked into saveReady?! When I want manipulate uploaded files, I always use something like this: // code snippet that belongs into the site/ready.php file: $wire->addHookBefore("InputfieldFile::fileAdded", function(HookEvent $event) { $inputfield = $event->object; // handle to the image field if(!$inputfield instanceof InputfieldImage) { // we need an images field, not a file field return; // early return } if(version_compare(wire('config')->version, '2.8.0', '<')) { $p = $inputfield->value['page']; // get the page, PW < 2.8 } else { $p = $inputfield->attributes['value']->page; // get the page, PW >= 2.8 | 3.0 (or only from 3.0.17+ ??) } $image = $event->argumentsByName('pagefile'); // get the image // now do something with the image or file ... });
×
×
  • Create New...