-
Posts
1,070 -
Joined
-
Last visited
-
Days Won
16
Everything posted by dotnetic
-
Hey @Macrura I haven't tested "dynamic domains" because I don't use them, but the region setting for "EU" domain and also tracking for message open and clicks, which are working fine. I also committed another patch for strange display behaviour in outlook: https://github.com/chriswthomson/WireMailMailgun/pull/14
-
Better way to check for minimum count if($total > 3)
dotnetic replied to hollyvalero's topic in General Support
Damn, I am very sorry. I mislead you. I thought it returns false, if the count fails, but it turns out, it really returns the number. Sorry. I updated my example above, which is basically the same as @Autofahrn's -
Better way to check for minimum count if($total > 3)
dotnetic replied to hollyvalero's topic in General Support
@elabx You are also correct with your statement, that integer 0 loosely evaluates to false. But as @Autofahrn said, the original poster @hollyvalero wants to work with the product array afterwards. But as my query does only return false or the integer number, that is not what he needs. So something like $products = $pages->find("template=news, limit=9, sort=sort" ); if($products->count > 3) { echo $products->each(function($product) { return "<p>$product->title</p>"; }); } would be correct -
Better way to check for minimum count if($total > 3)
dotnetic replied to hollyvalero's topic in General Support
@Autofahrn is right. -
Better way to check for minimum count if($total > 3)
dotnetic replied to hollyvalero's topic in General Support
Yes, Tracy is a must have module to debug -
Better way to check for minimum count if($total > 3)
dotnetic replied to hollyvalero's topic in General Support
Even shorter: $products = $pages->find("template=product, limit=9, sort=sort")->count(3); if ($products) d($products); -
@nbcommunication Thanks for your work on this module. Maybe @Macrura could merge your latest changes? Would you create a pull request for this? As far as I can see everything is working fine here. I use this module in conjunction with @ryan's ProMailer module to send out newsletters. I even used the tags method, to enable analytics.
-
Turn on $config->debug in your site/config.php, then you get a better error message, that says what the problem is. Look under details of your image field and then "formatted value". Is it set to automatic? Is "Maximum files allowed" set to 0? If so, try <img src="<?php echo $page->header->first()->url; ?>" alt="<?php echo $page->header->first()->description; ?>" /> That is because an array is returned if "Maximum files allowed" is 0.
-
how to change the default language in processwire cms
dotnetic replied to wish-fulfillment's topic in Getting Started
@wish-fulfillment In your site tree look for the root page and in the settings tab look which URL it has for russian (your default). It should be (ru) However, I noticed that it is a bad practice to modify the default language (english) with language files. Instead you should add russian as an ADDITIONAL language and then set the guest user to this language (for the frontend) and also your admin user, so the PW admin is also in russian. Made the same mistake as you on a big site (although it works) and now it is too much work to change it. Edit: This is not the case anymore -
Just want to thank @horst for all his work on the WebP integration and the effort for explaining many things (of which I am aware, because I also have a background in image retouching and stuff, but most people do not).
-
LOL. This is because I have far more domains on the live server and didn't want to write them all. Most of my dev server settings could also be omitted; I only use one dev domain ATM.
-
Hi @bernhard Here is my solution which uses the server name instead of a directory structure. So you are safe if you are changing paths or the OS where paths are different. $base_url = $_SERVER['SERVER_NAME']; $config->base_url = $base_url; switch ($base_url) { case "p-jentschura.localhost": case "p-jentschura.acemanpc": case "p-info.localhost": case "p-info.acemanpc": $config->dbHost = 'localhost'; $config->dbName = 'dbname'; $config->dbUser = 'root'; $config->dbPass = 'dbpass'; $config->dbPort = '3306'; $config->debug = false; $config->httpHosts = array( 'p-jentschura.localhost', 'p-jentschura.acemanpc', '192.168.178.16', '192.168.178.23', 'localhost.p-jentschura' ); break; default: // LIVE CONFIG $config->dbHost = '127.0.0.1'; $config->dbName = 'dbname'; $config->dbUser = 'dbuser'; $config->dbPass = 'dbpass'; $config->dbPort = '3306'; $config->debug = false; $config->httpHosts = array( 'p-jentschura.com', 'www.p-jentschura.com', 'p-jentschura.de', 'www.p-jentschura.de', 'p-jentschura.nl', 'www.p-jentschura.nl', 'p-jentschura.shop' ); }
-
Thanks @horst. Hopefully @ryan will include this quickly into the core.
-
I also love to see some progression on WebP. @Tom. Glide also utilizes GDLib or Imagick, so I don't know, if it will be an enhancement, as PW already does this too. Do you have any examples of the reduced image quality? I did not notice quality loss, in terms of blur or oversharpening yet. Are you also aware of the different settings for ImageSizer like sharpening or upscaling? You can change these settings in your site/config.php $config->imageSizerOptions = array( 'upscaling' => true, // upscale if necessary to reach target size? 'cropping' => true, // crop if necessary to reach target size? 'autoRotation' => true, // automatically correct orientation? 'interlace' => false, // use interlaced JPEGs by default? (recommended) 'sharpening' => 'soft', // sharpening: none | soft | medium | strong 'quality' => 90, // quality: 1-100 where higher is better but bigger 'hidpiQuality' => 60, // Same as above quality setting, but specific to hidpi images 'defaultGamma' => 2.0, // defaultGamma: 0.5 to 4.0 or -1 to disable gamma correction (default=2.0) );
-
I have this option in my site/config.php file: $config->imageSizerOptions = array_merge( $config->imageSizerOptions, // all items from wire/config array( // overwrite specific items 'defaultGamma' => -1, ) ); I think the cause was something similar to what you experience with the colors, but I am not sure. Maybe try this setting.
-
[Solved] Impossible to return Processwire to english?
dotnetic replied to Hurme's topic in Multi-Language Support
@Hurme @wbmnfktr Regarding setlocale, pls read my post The message @Hurme described, is most likely this one https://github.com/processwire/processwire-issues/issues/732 correct? -
I only used the module FieldtypeRuntimeMarkup for now and it works, but has one big disadvantage (which maybe not applicable to all users): You can not use the runtime markup fields in a ListerPro to sort because PW is looking for a database table and throws an error.
-
@Violet With "migrate to another domain name" you mean another server, right? If so, I also recommend copying the database via adminer or PHPMyAdmin. For copying the files, use rsync over SSH (because of direct connection between old and new server and use of compression). If you don't have access to SSH I recommend downloading all the files via FTP and upload them on the new server also via FTP.
-
Useful tools: Design email in browser for free: https://mosaico.io @elabx Preview your email in different clients before sending: https://emailpreviewservices.com/
-
This might can be done via a .htaccess rewrite rule. I recommend asking this question on stackoverflow.com or https://serverfault.com (more server centric)
-
KeePassXC