-
Posts
4,077 -
Joined
-
Last visited
-
Days Won
87
Everything posted by horst
-
Get unique parents from children and make them a page array
horst replied to cb2004's topic in General Support
Not sure, but I think it is intentional. But also, you always can (re)order / sort it after adding a complete PageArray at once: http://cheatsheet.processwire.com/pagearray-wirearray/sorting-and-filtering/a-sort-property/ EDIT: Ok, thats not my evening. @BitPoet has already linked to PageArray->sort(), also to the newer API docs. Good night all together. -
Uuh, I read wiki, and thought it was the old wiki tutorial. But it was wikipedia. My fault, sorry for any confusion!
-
Ryan has closed it when changing the server, because it wasn't maintained a long time and also has filled up 3+GB (?!?) on the old server. There must be his post somewhere in the forums: https://processwire.com/talk/topic/13373-switching-hosts-may-25-at-noon-est/
-
Image in Repeater only editable by Superuser
horst replied to MonkeyTennis's topic in General Support
I'm not familiar with repeaters in PW 2.3. But I think in later versions of PW, this problem has gone. If this can be confirmed here by others, I would pull that site to a local install, and upgrade from PW 2.3 to PW 2.7., or at least, to PW 2.5, if there was the repeater issue fixed (depends on what other modules and stuff you uses). Need some confirmation of long time users here. EDIT: Oh, saw that this is your first post here. Welcome to the forums @MonkeyTennis.- 6 replies
-
- 1
-
- repeater
- crop image
-
(and 2 more)
Tagged with:
-
I believe your guess is wrong, Can you please paste in the original code you use in your ready.php, incl. the scope, (your hook method you use). Please use the <> button of the forums editor, it opens a modal that let you paste in your code and let you select the code type (php, html, css, js). This is of great help for readability.
-
hey @phil_s, we already follow the rules you linked too, with a bit more individuality: look for a gamma setting shiped with the image: https://github.com/processwire/processwire/blob/36984e4a057268b7a45b848e1b3b6ee757583459/wire/modules/ImageSizerEngineIMagick.module#L225 if there isn't one available, assume default value: https://github.com/processwire/processwire/blob/36984e4a057268b7a45b848e1b3b6ee757583459/wire/modules/ImageSizerEngineIMagick.module#L230 go into 16bit mode (if available in this imagick engine. there are also only 8bit engines!) https://github.com/processwire/processwire/blob/36984e4a057268b7a45b848e1b3b6ee757583459/wire/modules/ImageSizerEngineIMagick.module#L242 now do all imagemanipulations, ... and recalculate and set gamma back: https://github.com/processwire/processwire/blob/36984e4a057268b7a45b848e1b3b6ee757583459/wire/modules/ImageSizerEngineIMagick.module#L339 and set back the colordepth to 8 or lower, if the original has lower depth: https://github.com/processwire/processwire/blob/36984e4a057268b7a45b848e1b3b6ee757583459/wire/modules/ImageSizerEngineIMagick.module#L342 But it looks like your local workflow isn't correct. I suggest to read your first link to brasseur, but in regard of Photoshop and how it should be used. Using photoshop in short: don't use "save for web"! only work in 16 bit depth mode! Everytime!! (No, - no exceptions!) At the last step, procede reduce the color depth from 16 bit to 8 bit, but only for variations that you want to share / upload, etc! KEEP your 16 bit ORIGINAL locally! If you don't have original images in 16bit, first step after opening it in photoshop is, to increase the colordepth from 8 to 16. Then do all your stuff, and at last step, reduce the colordepth back to 8 bit. For using images as a master source in PW, I highly suggest(ed) to save images in Photoshop as jpegs in 12 (=100%) quality. (NOT with saving for web, just the regular "save as jpeg" method). Don't deliver your original image in PW, never. If you need it in its original dimensions, call it with $image->width($image->width). This way, you get a variation with original dimensions but lower quality, your default image quality. Or pass an array with different quality setting with the image to the pageimage / imagesizer. EDIT: If you embedd an ICC profile or not, is not relevant. But you need to use / have the image in sRGB!! This is assumed by all web image render engines. GD, for example, isn't able to read ICC profiles. Some IMagick installations also don't / cannot.
-
Interesting question! I give a like for it. OT: I always would use namespaced template files for new projects now. (Skipping all filecompiler interaction for template files)
-
additionally to what @adrian said, it is possible to define those both templates in the admin, one plural and one singular, to build a family out of them. But if you like, you can use one template file for both. If you have created an advertisements.php under site/templates/, create the plural template first. When creating the singular template, select ceate a template without template file in the first screen, (write your singular template name into the input box, without the fileextension). Save, open again and head to the tab [files]. There you select to use an alternative template file, your plural template file. Now you have two templates for easy sort between parent and children, and one templatefile that renders your markup. If you want to render it the same, do nothing special. If you want to render parent and children different, you can check the template name like // this block is skipped by child pages if("advertisements" == $page->temlate) { // chek for plural / parent template // do your stuff ... return; // end template file processing here for all parent pages } // do your stuff for child pages (single template pages) here, ... ...
-
and post_max_size should be > than upload_max_filesize add 10% - 20% for other postdata then uploaded files: post_max_size = (max_file_uploads * upload_max_filesize) * 1.15
-
For me, it fits perfectly, as I dropped using the SPEX module now, since region() is available. Before that, I used $spex->slot(). Now I'm able to define the main regions in my template prepend file like: // header nav region('headernav', ""); // the body content: region('content', ""); region('sidebar', ""); // all JS codes that should executed at document.ready event, // after jQuery and main.js are loaded: region('JSdocReady', "new myObj().init();\n"); and now, along the way, I can add more code / markup to them. Why I like to use region() over a php var (like $content .= ...), is, that it stands out in the code and indicates (for me) that this is not locally used var, but one of the main buffers that get echoed in the template append file. So, yes, its a personal preference. (That wasn't available before.)
-
Yes, everything that you may somehow "include" into template files. Maybe, physically every php file under /site/templates/.
-
@Ivan Gretsky, I like your point and request for a more detailed explanation to the pro and cons in use cases of API-vars and API-functions! But to be honest, with the region function you overcomplicate things. When you want to use the region function, you will use it all over your tempate files and I'm pretty sure, that you know how it works. (Means, you don't need your IDE telling you about it) But if you really need it, just let out the + sign for a moment, listen to your IDE, and then prepend or append the "+ sign". Ok? @ryan the prepend and append plus-sign is the best of all. The region function is the best, but with the plus-sign functionality it is top of the best!
-
You may also add a "namespace ProcessWire" into the first line of that template file and set the filecompiler to 0 / none for only that template. But, if you started to work with PW3 now, and will do so in the future, I suggest to always use the namespace ProcessWire in your template files (and sub files) and skip the file compiler completly for all template related stuff! Here, in template section, you have full control, other then in modules section, if you want to use third party modules that are not written as native PW 3 versions.
-
just a thought: have you tested it with a trailing slash? array('exclude' => $config->paths->templates.'errors/')
-
[solved] Can i Switch to 3.0.39 Dev branch easily ?
horst replied to EyeDentify's topic in Getting Started
@EyeDentify, also without any asperger, it is sometimes hard to grasp things. (the forums are full of examples, ) But yep, with PW it is really nice to work. You can start with simple things and then go deeper and deeper. Every step gives you a bit more learning and understanding. And that's why you want to go deeper again. (but caution: it can be a bit addictive!) -
[solved] Can i Switch to 3.0.39 Dev branch easily ?
horst replied to EyeDentify's topic in Getting Started
no worry, updating this way is fine. only changing the wire folder is enough. -
sorting descendend, and not ascendend?
-
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";
-
ui, thanks! Corrected!
-
-
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?
- 1 reply
-
- 1
-
@Matcha The module installs a permission: "croppable-image-3". Have you given that to the roles that should be able to work with it?
-
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.
-
Many thanks for the contribution. Does it work with PW 3, too?