-
Posts
4,088 -
Joined
-
Last visited
-
Days Won
88
Everything posted by horst
-
What is the server setting for uploads? What output is in the JS-console when your upload freezes? Do you have any log entries for images in PW? $config->debug = true?
-
My personal preference is not to update the .htaccess file automatic. If something breaks, the complete site may become unrenderable. Also warning mechanism may not get invoked then(!). Additionally I only allow read access to the file for security reasons. So my favourite would be to collect candidates and provide them as alphabetically sorted markup on demand
- 35 replies
-
- 2
-
-
- antispiders
- anticrawler
-
(and 2 more)
Tagged with:
-
I use Redirect gone ... in .htaccess Redirect gone /wp-login.php for all that stuff. (First I log 404s for a period, than I add those candidates to the .htaccess, before ProcessWires entries!!) I think it is better to not invoke PW for this stuff, (lesser overhead on the server!), instead use apache custom error page(s). 47ms is fast! PS: 410 is better than 404, as I also use this for SearchEngineRequests that try to reach URLs that do not exist since 10 years or so. Normally the SEs should flush their cache on 410 returns.
- 35 replies
-
- 3
-
-
-
- antispiders
- anticrawler
-
(and 2 more)
Tagged with:
-
Ajax - Send raw template only, without _main.php
horst replied to Jim Bailie's topic in General Support
To enable this, depending on your PW-Version, you may need to set the $config var useFunctionsAPI to true: $config->useFunctionsAPI = true; // pages()->find(), sanitizer()->pageName(), region('content', $markup), Links: https://processwire.com/blog/posts/processwire-3.0.40-core-updates/ https://processwire.com/blog/posts/processwire-3.0.39-core-updates/#new-functions-api https://processwire.com/blog/posts/processwire-3.0.39-core-updates/#new-region-function PS: To easily find things on the PW site, you may use g**gles search like this: site:processwire.com $config->useFunctionsAPI -
Ajax - Send raw template only, without _main.php
horst replied to Jim Bailie's topic in General Support
That's ProcessWire! A series of ways to reach your goal. Pick your favourite: Do you like uphill climbing, go there. Do you like to stroll, go here. Another way would be to put a snippet like this into the top of your _main.php: <?php namespace ProcessWire; if('ajax' == $page->template || $config->ajax) { echo region('main'); return; } -
can you show a full url of an image please?
-
Noob - Quickest way to create a site like the demo?
horst replied to ComputerKid's topic in Getting Started
Hi, there should also be a site profile in the directory called "blue vr" or alike. This is inspiring too. -
Ajax - Send raw template only, without _main.php
horst replied to Jim Bailie's topic in General Support
You can create a separate template for the ajax page (a single page URL, that is called for all ajax requests) and check both to be disabled, prepend and append files in the template settings. Under templates / files: deactivate auto prepend of _main.php -
I would adapt the local server to be as much equal as the production server, if possible.
-
module ImageOptim — automatic image optimization
horst replied to d'Hinnisdaël's topic in Modules/Plugins
Hi @d'Hinnisdaël, many thanks for this well crafted module. I (only) have read the modules code and checked some, (maybe critical) points for image modules . Everything seems to be well done! Only one thing I spotted, needs a bit clarification from you, as I may not see the whole picture yet. You added a new hook delete to Pageimage. I cannot see how this integrates with PW's methods for deleting variations. How gets it invoked when I a) delete an image via UI and b) when I call removeVariations() via the API? Or what is it for, exactly? Besides the integration with unlink & removeVariations, it may be very useful to have a function that only removes the variations from ImageOptim! TL;DR -
@mscore if you think this should be included in the core module, you should send an issue or feature request at Github, to get better recognition! And many thanks for sharing this solution!
-
Selector operator *= does not always find a match
horst replied to Marcel Stäheli's topic in General Support
has something to do with settings of your MySQL server. The string is only 3 chars long. Try someting with 5 chars for example. -
site-profile Yet Another Blog Profile: Editorial
horst replied to BitPoet's topic in Themes and Profiles
After reading this, I looked into your github page and found out that you also converted the strongly typed template. One month ago, I picked up three themes from HTML5up as starting points for low budget or honorary projects: The "Editorial", the "Strongly Typed" and the "Phantom" = 66% accordance -
As far as I know, the documentation gets generated directly from code comments. For example the WireMail class: API Doc: https://processwire.com/api/ref/wire-mail/ Code: https://github.com/processwire/processwire/blob/master/wire/core/WireMail.php#L9 My personal conclusion: if you want to contribute to the docs, you need to understand the "comments markup" and contribute directly to the github code base via issues or pull requests. Edit: and also that you are now a registered forum member for more than one and a half year: Welcome to the forums!
-
My experiences in 15 years with PHP on windows told me to not make any (platform) differences with filesystem related stuff. Simply use the / forwardslash for everything as long as you can achieve all operations with PHP internal functions! (copy, delete, ZIP!, etc) The one and only rule where you need to convert forwardslashes to backwardslashes on windows is, when you do calls in the commandline via exec() or system(). All other stuff is handled well from PHP internallly across all platforms. So, on windows you should not use functions like realpath() or dirname() without to convert backslashes to forwardslashes afterwards! Thats the only rule I followed all the time. (locally detect windows = convert \ to /)
-
I'm not aware of any crossplatform differences with the internal PHP ZIP functionality. What is the issue you are speaking from? Also, I have (re)written a ZIP library in pure PHP that is only one single file. But this was in the times as the included ZIP in PHP wasn't available on many hosts.
-
Since early 2013, when I found PW, the lowest PHP version it needs to run on is /was 5.3.8.
-
Hi MrKing, if the above tips doesn't suite your needs, I can provide you example scripts of individual imports.
-
Ha, I'm a late adaptor in so many parts. Feels really good to be one of the early birds in this special case.
-
The only reason for bootstrapping in this usecase was, that I prefer this for administrative tasks. The pros are: cli access directly gives you superuser rights without extra login steps; it is very fast by copying the bootstrap script around in my local filesystem; It also works from more levels above the webroot; ... HTH to clarify. ?
-
I personally use a more verbose method when developing a side, as a max files may be changed during developement. // get the field unformatted, always returns an array, (not bound to context) $images = $page->getUnformatted('images'); // check if an image is available then always is via count if(count($images)) ... // get the image of a single image field always is via the first method $image = $images->first(); When switching from single image to multiple images or vice versa, always has potential to break some code. That's why I use this verbose method during development and only rework the code as a last step before deploying to public.
-
I think the simplest way would be to use Beas module ImageExtra , or you look into it and "borough" some code. Info: https://www.kf-interactive.com/blog/adding-custom-fields-for-images-in-processwire/
-
https://processwire.com/talk/topic/13759-tagging-multiple-images/#comment-123851