Leaderboard
Popular Content
Showing content with the highest reputation on 05/18/2016 in all areas
-
Typically the easiest way to avoid loops with save hooks is to just save the field, rather than the whole page. So, do: $pageToSave->save('relatedPageField'); // or whatever the name of the field is4 points
-
I have just added a new config setting: Local Root Path which you can use to modify the editor links from a production server to a your local dev files - I think this is a really handy improvement. If you have the remote server mapped as a local drive, you could even point to that if you'd prefer. It also includes a bunch of Tracy core updates, including support for AJAX errors on the bluescreen, but you guys can read more about the changes here (https://github.com/nette/tracy/commits/master) if you want.3 points
-
Ckeditor is certainly not suited for this. I can imagine that Profield Matrix can make things more intuitive for the Editor in the admin, however, I think it can be implemented with a simple repeater too, and it will be usable. It might depend on the amount of gray matter the client is equipped with Also, we should not forget that simple repeaters might stop working around 50 items (Pages) depending on the available memory.3 points
-
These days I would handle this issue with CSS: div:nth-of-type(even) { } div:nth-of-type(odd) { } But since it took me a while to understand this modulus operator stuff I'll give you an example: <?php $i = 1; foreach($page->repeater_field as $repeater) { $i++; // 2, 3, 4, 5, etc echo '<div class="' . ($i % 2 == 0 ? "odd-item" : "even-item") . '">'; // % is the modulus operator echo '</div>'; }3 points
-
Have a read about the PHP modulus operator - that should get you started.3 points
-
I suggest to use Pia. With Pia, you simply can define the (max) outerbox dimensions and it will return you an image with dimensions that fit into it. Means, if you define a 600x600 box you will get back an uncropped image variation where the larger side is 600, regardless if it is portrait or landscape. If you like to have larger landscapes than portraits, you can define width=800, height=600. It is simple. Examples with Pia: $thumbnail = $image->contain("width=800, height=600"); $thumbnail = $image->contain("square=600"); If you have many different aspect ratios with your images, you also should have a look to Pias option "weighten"!3 points
-
OK, my issue. The DB does have UTC time; I hadn't realized it was configured with SYSTEM time, so it's doing a conversion on output. I just need to configure MySQL appropriately. It would be nicer/easier to use if the timestamp was a Unix time value rather than a timestamp.3 points
-
@rick900 - welcome to the PW forums. Any chance you could provide some code to show how to integrate payolee within ProcessWire.2 points
-
For such situations the profield matrix repeater module is a good option. It saved me a lot of headaches I would have faced if I have gone the ckeditor route.2 points
-
I've to write a little love letter! I just play the whole day with your modules and i've to say that i'm very very overtaken by your simple modules with a real big benefit to rule API forms and user managment things! Thumbs up for your input on this topic! Until now, all i've done worked and i will use this for my first bigger community project website (about several hundred frontend users) and will report how fu() will work. But this modules follow PW basic rules - simple - easy to use so i don't see any rough edges... Just wanna say a real big thank you and make the suggestion to put the modules from "alpha" state to "beta" ...since many things are fixed the last few months and i think theese modules are indeed in production use... Best Regards mr-fan2 points
-
@kongondo You're generosity at making this excellent module available and providing all the help you do is so much more than one should expect; NO problem re [Hope to get some time soon to look into your questions...sorry...] thanks again for this module and good luck in all your endeavours, cheers2 points
-
Good suggestions, by using Pia, you won't have to touch the slick code. If you would decide to convert some images to vertical, you would have some big headaches to change the css that you already defined for slick. If you do decide to go with vertical images, I would advise you to use the images as background of an empty element instead to make them responsive and avoid strange distortions. You can keep the proportions of an empty element with this very interesting but simple trick http://stackoverflow.com/questions/1495407/maintain-the-aspect-ratio-of-a-div-with-css, and then set the images as background with cover and contain sizes.2 points
-
I got it working, but the "General" context will be gone. I think it's even better this way. Will upload a new version soon, after testing the different variations a bit.2 points
-
Hi kuba2, If you use ProcessWire to crop the image like this: $image->size(800,600);, you will not be able to get a portrait image. I have never used Slick Slider, but you need to change the way you adjust the size of the images in order to work with an image file which is higher than it is wide.2 points
-
2 points
-
Template Latte Replace Latte template engine support for ProcessWire Having wrote about this one for a few times and now here it is. The readme is not complete but should give a solid starting point. Feel free to ask if something's not clear. http://modules.processwire.com/modules/template-latte-replace/ https://github.com/rolandtoth/TemplateLatteReplace1 point
-
FormHelper The redesigned FormHelper extends the InputfieldForm object with additional features. Features The FormHelper module extends the PW form object and simplifies the form handling. create basic PW form object with submit button add form field value handling and sanitizing take care about form submit / error state and processing CKEditor pwImagePlugin field, jsConfig, load form admin styles FormHelperExtra is a submodule to handle additional features. create a form object with fields based on Template, Page, Form objects or field data array form file upload handling (temp page uploads, creation of a hidden storage page) Usage Documentation / examples Repository PW module repo GIT repo ToDo / Issues Issues1 point
-
TextformatterCurrency A locale-aware currency formatter module for ProcessWire. The module reads a formatted string, splits it and formats each valid monetary amount according to the locale defined in the module settings. The module is capable of using the visiting browser's headers to determine which locale to use when formatting monetary amounts of various currencies. Internally, the module uses PHPs Internationalization extension (intl) to do the formatting. Input money format The input money format is made up of any number of currency-amount pairs. Each input money pair is made up of 3-letter ISO 4217 currency code and a numeric amount. These are always separated by at least one space with the code coming first. (eg. "GBP 50.99" or "JPY 100000") No thousands separators are allowed in the input. A full-stop '.' character is the only acceptable decimal separator. Each money pair is separated by a configurable character string ('|' by default.) You can change the character used to split the incoming string into currency-amount pairs in the module settings page. Output format Each currency-amount pair is formatted using the defined locale or that supplied by the browser and thus appears localised in the output of the formatter. If the input text has more than one currency-amount money pair then the formatter will join the localised outputs for each pair using the output glue string defined in the module settings. Negative amounts are prettified by substituting ascii '-' characters with the more typographically pleasing minus glyph '−'. Examples Using Module Defaults Input "GBP 50.99 | EUR 100" gives "£50.99 + €100.00" when viewed in browser set to British English but gives "50,99 £GB + 100,00 €" using a browser set to French. Availability On github. In the module repository, here.1 point
-
v015 is uploaded to GitHub. Syntax for string translation in .latte files is changed to "{_'text, context, textdomain'}". In textdomain use "__()" if you need no context, and "_x()" if you do.1 point
-
Would be also possible with PageTableExtended to render the setup in the backend use Drag&Drop and two settingsfields for the entries (colorselect and image left/right)...i use PTE as a contentblockbuilder on many cases this would be no problem.1 point
-
Thanks adrian, such a simple solution, I hadn't realized you could save individual fields.1 point
-
@chuguruk, you have one recent entry in the FrontEnd User thread: I would kindly suggest that you make another entry in that thread and let the developer know more about how that module is not working anymore.1 point
-
Thanks for all the testing! Just to let everyone else know - Charles has tested the latest version (just committed) and it is working properly with PHP 7. Glad you sorted out the cron issues!1 point
-
Something like this to get you started? http://snook.ca/archives/php/the_modulo_oper1 point
-
Hey, owzim! Thank you for your wonderful module! Any chance making in PW 3 compatible in WireArray mode? Seems to be not so hard - just reference ProcessWIre classes with namespace. But I may be underestimating it, of course.1 point
-
Error seems to have resolved with new cron. Thanks will try with "/dev/null 2>&1" if it repeats.1 point
-
<removed> offers subscription and recurring payments.1 point
-
Went back to PHP 7.0.6 and did the upgrade to the newest ProcessEmailToPage version. I sent you a PM with the results.1 point
-
Thanks Charles, Please try the latest version. I don't have currently have a PHP 7 setup to test so there might be additional errors, but that one should be fixed.1 point
-
1 point
-
@Charles - i have it running on that same version with no errors; what version of PHP are you running with that?1 point
-
Adrian/Pete, I am having a problem with this module on a newly fresh install of 3.0.17. The module installs alright However, whenever you click the settings button, this is what I get: Any help you can provide is greatly appreciated. It works on other installs (even ones that have upgraded to 3.x). I have been meaning to spend some additional time troubleshooting this issue but just haven't had the free time.1 point
-
Seen such 'blank' images before. Happened when PHP run out of memory to process a big image. It always annoyed me that ImageSizer insisted on creating the blank image rather than giving up . About not being able to delete them...it means they were still in memory being processed, basically, in a crazy loop I suppose. So, check your memory, or your image size, or use $pages->uncacheAll() after each resizing or increase your set_time_limit(60)/ or 30 maybe, inside your loop to avoid timing out or a combination of all these tricks...With the latest ImageSizer though I think (?) such issues have been resolved...don't quote me though...haven't tested it yet1 point
-
PW aborts the page in a case the page isn't viewable or not found and renders the 404 instead. A 404 is never a redirect to the 404 page. A 404 always stays at the requested URL and sends a 404 header instead. The rendering of the 404 page does a $page->render(), thus calling the init.php again. That's why you should include() a functions php with required_once() or alike to avoid redeclarations.1 point
-
Following on from Kongondo's answer: https://processwire.com/talk/topic/4134-include-template-name-in-admin-page-list/ Although you might want to do it via the ProcessPageList settings so that it works for all templates: /processwire/module/edit?name=ProcessPageList1 point
-
Well, it's not THAT easy. Check here: https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-elasticsearch-on-ubuntu-14-04 I suggest you read about the way ElasticSearch works to understand what is possible and what is not, and how to adapt it to your needs. It seems easy, but it a mighty thing and as such can easily cause more trouble than it's worth.1 point
-
To quote Ryan's latest blog post: https://processwire.com/blog/posts/more-images-upgrades/ - note the bit about "custom meta data fields"1 point
-
Just spotted this in a post by Ryan (here); Although my own use-case for this module is for an invoicing system that is not publicly accessible - I can see that this might be the case if this is used on public facing PW pages. Unless anyone can suggest a better way, I'll look at adding a method to allow the locale to be set after the module is loaded (either from a template file or perhaps ready.php.) This should allow a site to control its own URL-to-locale mapping and still use this module as a textformatter if desired.1 point
-
@Marcel Epp #1: Yes, the code is right here: #2: My German isn't great but I think you are referring to the Posted by Franz Beck on 11 May 2016. That comes from here, the option post_date_text. As you can see, it is an empty string. My reasoning was that you cannot translate an empty string (although I don't know how the translation parser works). Instead, the idea is that you provide the translation/text yourself like so: $content = $blog->renderPosts($page, false, array('post_date_text' => 'on'))// whatever you want 'on' to be @All Others... Hope to get some time soon to look into your questions...sorry...1 point
-
@shamus - sorry for the delay in getting back to you - I have made a start on investigating this and improving the importing in general - stay tuned! @Robin S - I posted about this here: https://processwire.com/talk/topic/10517-frontend-password-reset/?p=119386 - it's a bug in the Password Reset module, but I have implemented a check in BCE that will prevent the error - instructions on how to implement are also in that thread.1 point
-
FrontendUser and FormHelper modules are small helpers to use the form api and PW login in the frontend, because the core modules aren't fit my needs. I know that PW not supports the frontend usage of core modules (login, forgot password, ...), form api and inputfields, but it would be great. I hope in the future some modules / core features will be simplified and with frontend usage in mind (also if not official supported). Login without build in admin notifications Most of the inputfields work in the frontend, but I don't like the QueryUI dependency Simple form handling / verification (FormHelper fhProcessForm) with a single method call ... But because that isn't planned we need such community modules1 point
-
Just wanted you to know, that I deprecated FieldtypeDataStructure, the repo will still be there and the added parsing features are still on the dev branch. I will just not longer maintain or support it. Meanwhile I merged some features into the orginal Fieldtype YAML repo, made it beta and updated the links on the module page. So it stays focused on YAML.1 point
-
Thanks Sinmok and netcarver. It would be really useful when we are using a front-end framework like Bootstrap. <?php $list = $pages->find("template=basic-page"); // Returns 5 pages $chunked = array_chunk($list->getArray(), 3); ?> <?php foreach($chunked as $i => $row): ?> <div class='row'> <?php foreach($row as $item) : ?> <div class="col-md-4"> <?php echo $item->title; ?> </div> <?php endforeach; ?> </div> <?php endforeach; ?>1 point
-
Hey Marty, I'll take a stab at this. There are a few issues as I see things: The Max Image Dimensions setting: "..... does not affect any images in the system, or images added via the API." but you have noted that already. From your explanation it sounds like the images are already installed. You could resize everything using the API, but then you'd end up with the original sized one as the main image still, but will the sized variation available - I don't think this would help much. So if you upload using the API, you'll need to do the resize yourself. Of course the $image->size() method in the PW API will add the .XxY suffix to the filenames. So I have a couple of scripts for you. This first one allows you to install an image using the API and have it resized to match the Max dimensions settings. This assumes your images field is called "images". I don't think this specifically helps you since you already have the images installed, but I wanted to post this in case it helps someone else. Read below for the next version which I think does what you need. $cp = $pages->get("/"); $url_to_image = "http://ian.umces.edu/images/ian_banner.png"; $cp->images->add($url_to_image); $cp->of(false); $cp->save("images"); $pagefile = $cp->images->last(); $imagesfield = $cp->fields->get("name=images"); $filename = $pagefile->filename; $pagefile2 = null; if($imagesfield->maxWidth && $pagefile->width > $imagesfield->maxWidth) { $pagefile2 = $pagefile->width($imagesfield->maxWidth); unlink($pagefile->filename); rename($pagefile2->filename, $pagefile->filename); $pagefile->getImageInfo(true); // force it to reload it's dimensions } if($imagesfield->maxHeight && $pagefile->height > $imagesfield->maxHeight) { $pagefile2 = $pagefile->height($imagesfield->maxHeight); unlink($pagefile->filename); rename($pagefile2->filename, $pagefile->filename); $pagefile->getImageInfo(true); } I think this code should do what you need. Obviously the first line sets the $cp to the home page, so you'll need to adjust as necessary. After that it runs through all the image fields on that page and resizes the images to match the values in the Max Dimensions settings. Let me know how you go with it. $cp = $pages->get("/"); $cp->of(false); // required for a single image field foreach($cp->fields as $imagesfield){ if($imagesfield->type == "FieldtypeImage"){ foreach($cp->$imagesfield as $pagefile){ $filename = $pagefile->filename; $pagefile2 = null; if($imagesfield->maxWidth && $pagefile->width > $imagesfield->maxWidth) { $pagefile2 = $pagefile->width($imagesfield->maxWidth); unlink($pagefile->filename); rename($pagefile2->filename, $pagefile->filename); $pagefile->getImageInfo(true); // force it to reload it's dimensions } if($imagesfield->maxHeight && $pagefile->height > $imagesfield->maxHeight) { $pagefile2 = $pagefile->height($imagesfield->maxHeight); unlink($pagefile->filename); rename($pagefile2->filename, $pagefile->filename); $pagefile->getImageInfo(true); } } } } Both examples are quite verbose and I am sure could be optimized quite a bit, but should get the job done. I did some testing and they both seem to work just fine.1 point