-
Posts
4,088 -
Joined
-
Last visited
-
Days Won
88
Everything posted by horst
-
Get unique parents from children and make them a page array
horst replied to cb2004's topic in General Support
double-like! -
I wouldn't consider it a bug of the croppable image module, as this seems to be only at your server (setup). Please provide the exact reproducable steps you have done, incl. installing and configuring the module. (You may try this by yourself in a test account, and if this behaves as you described, tell us the steps here, so that we will be able to reproduce it.) What does "Permisions ar OK" mean, exactly?
-
Get unique parents from children and make them a page array
horst replied to cb2004's topic in General Support
Isn't it, that you have an PageArray already in $result? Why not sorting this instead of the loop and double PageArray? Or do I get it wrong, what you are after? -
I'm not aware of any issues with repeaters or repeater-matrix. (Repeater-Matrix would do no change, I believe, as it somehow extends repeater) Custom cropping is made for which user / role. Does he have the right permission added to his role?
-
all very useful snippets and hints! My current question was simply how the apache directives are that block access, and work in any Apache version (2.2, 2.4) I thought there were a need for different terms, depending on the apache version. But now, after reading @Martijn Geerts example (Thanks!), I saw that the Files-directive is also available in Apache 2.4. (unchanged as it was in 2.2 and also 2.0 and 1.3, and ...). So, thank you all for your help and tipps. This solved my question! @BitPoet: this one is very handy too. I bookmarked it for later, other use cases. Thanks!
-
it seems, that @arjen also knows Wikipedia:
-
Hi @Robin S, thanks for the hints. I search for a solution to secure pagedirectories from any http access (403 for everything). These pages are for internal use through a module. But I don't want to have the user to change $config settings for that. It should be done silently in the background for the module users. So, I believe I have to go the .htaccess way per directory. Only thing here is, I have to support apche 2.2 and 2.4 together. Does anybody know if this is working on every Apache 2.4 installation? <IfModule mod_authz_core.c> ## directives for Apache 2.4 Require all denied </IfModule> <IfModule !mod_authz_core.c> ## directives for Apache 2.2 Order deny,allow Deny from all </IfModule> Or if it is possible to find Apache 2.4 installations that do not have the mod_authz_core.c enabled / compiled in?
-
yes, it first checks if we have a grayscale image. If yes, we use grayscale as workspaceColorspace, otherwise \IMagick::COLORSPACE_SRGB. If you want to test it out, you also can change this in line 184 and use \IMagick::COLORSPACE_RGB (without the s! / sRGB and RGB) Also, if you feel adventures (==abenteuerlich?), you may test with disabled and enabled gamma conversion. Maybe you can experience some differences? To test without gamma correction, simply comment out the line 246. I'm interested in seeing / discussing anything you find. ----- The truth with Imagick is, at least with the PHP extension, that you cannot use any version check for detecting features. There are so many possibilities to compile it. If there is one thing not supported, the php extension simply seems to omitt that and silently return a 0. And with the CLI extension, (using convert), I tried to include all needed manipulations into one call. If we would call it multiple times, to determine some image attributes, it would to much slow down the process.
-
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!)