Leaderboard
Popular Content
Showing content with the highest reputation on 01/26/2018 in all areas
-
This week we’re back with a new dev branch version that adds a new feature we think you’ll like: focus point image cropping. That’s also the “focus” of this blog post. This version also includes resolutions to numerous issue reports and more. https://processwire.com/blog/posts/pw-3.0.89/21 points
-
If the CustomerCode can be identical, you're likely creating identical names within a second. In that case, I'd add a simple counter to the page name seed.4 points
-
Don't want to divert this thread, but I first got my feet wet with more advanced SQL stuff reading https://philip.greenspun.com/sql/index.html He used AOL server and Oracle, but the underlying principles and problems are similar in the entire DB-world I guess. And what's more, the guy was involved with really huge companies and lists some real-life problems and solution-approaches. Was kinda fun to read back in the day (the nerd-kind-of-fun). tl;dr: Just keep on learning, today there's a million times more learning opportunities than 30 yrs ago (free software, online tutorials/courses etc., cheap hosting, and faster internet than dialup...).4 points
-
That is absolutely feasible. An application doesn't really care where it gets its data from, you just need to send a PWA compliant app bundle down to the client and within that app consume some APIs to get data. Whether that API is on a Digital Ocean, AWS, Linode server, or whether its written in NodeJS, PHP, Ruby, Go or whether its built on top of Wordpress, Magento, ProcessWire doesn't make much of a difference. I'm not sure how familiar you are with PWAs, but if you haven't built one yet I'd suggest you test it out without the ProcessWire part of the stack. If you can build a PWA that consumes the Github API, caches it with a Service worker and displays it offline. Then moving to a ProcessWire API Backend will be dead simple. ProcessWire is fantastic for this sort of headless/API based CMS, So you're making a good choice there4 points
-
What @BitPoet said. In other words, PHP is fast, MySQL is fast. So, there is no guarantee that you will have only 1 page created per second (your date), or even per microsecond! That leaves you with uniqueness dependent only on the customer ID ($client->CustomerCode). If you can guarantee that customer IDs are unique and that they only appear once per data set, (your JSON array) then you would be fine. The fact that you are getting a SQL error tells us that either your customer IDs are not unique and/or one customer ID is appearing more than once in your data set (i.e., it may be uniqe to the customer, but not the data set). If the database says so, then it must be so . Let me illustrate (non-unique customer ID and/or replicated customer ID): $clientCustomerCode = 12345;// replicating repeated use of customer ID $p = $pages->get(1722); for ($i=0; $i < 30; $i++) { // Create new page $new = new Page(); // Create unique hash {no guarantee this will be unique if same customer ID used} $unique = md5(date("Y-m-d H:i:s") . "-" . $clientCustomerCode); // even these (microseconds) do not guarantee uniqueness throughout #$unique = round(microtime(true) * 1000) . "-". $clientCustomerCode; #$unique = microtime(true) . "-". $clientCustomerCode; #$unique = microtime() . "-". $clientCustomerCode; echo $i . ': ' . $unique . '<br>';// display 'uniqueness'; you should see duplicates here // Set some variables for the new page //$new->setOutputFormatting(false);// not needed for a new page (I think) $new->template = "basic-page"; $new->parent = $p; // Create hash $new->title = "Title " . rand(5,15);// just for testing $new->name = $unique;// not really unique! // Save the page #$new->save();// you'll get PDO error here within a second } Using the above code, you'll be hit by the duplicate entry violation error within a second...3 points
-
@Gideon So very interesting topic, maybe you want to share your learnings in a post in the tutorials board?3 points
-
ImageSizerEngineIMagick is much more forgiving on large images than the default GD resizing engine, if you can make it available on your hosting. (And faster and all round better IMHO.)3 points
-
Enable tags in your image field Set predefined tag "homepage". Get urls of marked images $pages = wire('pages')->find('myImageField.tags=homepage'); foreach ($pages as $page) { echo $page->myImageField->get('tags=homepage')->url; }3 points
-
3 points
-
This week I got kicked out of my office, by weather, a furnace, and kids. So I don't have a blog post or a version update, though I do have a lot of work in progress that you'll see next week (including an item from last week's roadmap that I think you'll really like). It's been below freezing all week, and our furnace stopped working, so now there's no heat. Something called the heat exchanger cracked, and it looked like we were going to have to get a whole new furnace. But then we learned that the one we had was still under warranty, so the manufacturer is sending a new one, but it'll take a week to get here. Luckily we've got coats and a fireplace, but houses here in Atlanta really aren't built for the cold, so it's pretty frigid at a little over 50f (10c) indoors. I hadn't really planned on typing this much, but it's keeping my hands warm, so I'll keep going. It started snowing, which is something that doesn't happen often here. It was enough cold, snow and ice that the kids school was canceled for much of the week. So I've been having fun keeping an eye on them, but it's a challenge to keep a 7-year old and 4-year old occupied and away from TV. I grew up in Minnesota, so admittedly a part of me enjoys the cold and the snow. But unlike in Minnesota, snow in Atlanta pretty much shuts everything down. In this case, it's also been so darn cold that everyone is frozen after 10 minutes outside, so nobody wants to go out there. Today is the first day where things are starting to warm up, hopefully a trend. When I say the weather kicked me out of my office, I also mean literally. The day it snowed, water started dripping out of the office ceiling, right onto my head, which is... not what you want to see. There was no entry or access to the space in the ceiling for me to get up there and see what was going on. So I had to cut open the ceiling drywall to get up there and have a look. After making a big mess, I got up there and shined a flashlight around, the scene was surreal. It was a 2 foot high attic crawlspace full of snow, with some snowdrifts nearly a foot high. That answers the question of where the water came from… overhead lights produced heat, melted the snow, and it poured into the office. But how the heck did snow get into my ceiling? And how do I get it out of there before it all melts and destroys my office? As it turns out, the day it snowed was very windy. Structures around here have something called ridge vents at the peak of the roof. They run the length of the roof and vent hot air out during the summer. But if you get the right combination of wind and snow (like sideways and upwards blasting snow) it can get into the ridge vents, and into the attic… so I've learned. The conditions must have been perfect for it, because a whole lot of the snow got in. I've never seen anything like it, and hope I don't ever have to again. I ended up spending a day carefully crawling around on joists every 16-inches in those tight and completely dark quarters, trying to get the snow out of the ceiling and insulation. With a flashlight taped to my head, toting around buckets of snow on my hands and knees, I looked pretty ridiculous. Over a day I filled several big buckets full of snow and got it out of there. It was a pain to clear it out, but certainly much better than having it melt through my office ceiling. It's not been warm enough yet to know how much snow I missed (and will melt through), but with any luck, what's left will just evaporate. That was this week's adventures, which admittedly had nothing to do with ProcessWire, but that's why this isn't a blog post. Coming next week: a new PW version (with some exciting updates), a new blog post, and hopefully a new furnace.2 points
-
Well said. I've used it on my last project and was blown away by the results. Images turn out looking much better than with GD as well, without all that color banding crap.2 points
-
2 points
-
I think its time to reconsider the decision to split the repos in light of the hurdles and dissadvanatges separated repos bring for community support. If github cant provide the features required (which are not listed) - gitlab has private repos, protected branches etc etc... great points @StanLindsey thanks for sharing your toughts!2 points
-
I support this idea, has happened to me a lot and it's always memory, file size limits on upload or execution timeouts.2 points
-
If you've seen Verride Hotel, you've seen this layout before: http://restaurantecriatura.pt/en/ This is one of the restaurants in Verride Hotel in Lisbon. It uses the same base layout for the master site, with some new stuff here and there. Both opened doors this week so you can start making your reservations2 points
-
You're generating the variations with the API on the frontend, right? This sounds like a memory limit thing. I've had sites crash when they got a bunch of really big images added to a page. Access that page after and the processing time is clearly noticeable. On extreme cases I got a timeout, but refreshed the page and since most variations were already generated from the previous attempt, the second try goes through. This may help: https://processwire.com/blog/posts/processwire-3.0.63-adds-client-side-image-resizing/2 points
-
Hi everyone, Here's a new module that I have been meaning to build for a long time. http://modules.processwire.com/modules/process-admin-actions/ https://github.com/adrianbj/ProcessAdminActions What does it do? Do you have a bunch of admin snippets laying around, or do you recreate from them from scratch every time you need them, or do you try to find where you saw them in the forums, or on the ProcessWire Recipes site? Admin Actions lets you quickly create actions in the admin that you can use over and over and even make available to your site editors (permissions for each action are assigned to roles separately so you have full control over who has access to which actions). Included Actions It comes bundled with several actions and I will be adding more over time (and hopefully I'll get some PRs from you guys too). You can browse and sort and if you have @tpr's Admin on Steroid's datatables filter feature, you can even filter based on the content of all columns. The headliner action included with the module is: PageTable To RepeaterMatrix which fully converts an existing (and populated) PageTable field to either a Repeater or RepeaterMatrix field. This is a huge timesaver if you have an existing site that makes heavy use of PageTable fields and you would like to give the clients the improved interface of RepeaterMatrix. Copy Content To Other Field This action copies the content from one field to another field on all pages that use the selected template. Copy Field Content To Other Page Copies the content from a field on one page to the same field on another page. Copy Repeater Items To Other Page Add the items from a Repeater field on one page to the same field on another page. Copy Table Field Rows To Other Page Add the rows from a Table field on one page to the same field on another page. Create Users Batcher Allows you to batch create users. This module requires the Email New User module and it should be configured to generate a password automatically. Delete Unused Fields Deletes fields that are not used by any templates. Delete Unused Templates Deletes templates that are not used by any pages. Email Batcher Lets you email multiple addresses at once. Field Set Or Search And Replace Set field values, or search and replace text in field values from a filtered selection of pages and fields. FTP Files to Page Add files/images from a folder to a selected page. Page Active Languages Batcher Lets you enable or disable active status of multiple languages on multiple pages at once. Page Manipulator Uses an InputfieldSelector to query pages and then allows batch actions on the matched pages. Page Table To Repeater Matrix Fully converts an existing (and populated) PageTable field to either a Repeater or RepeaterMatrix field. Template Fields Batcher Lets you add or remove multiple fields from multiple templates at once. Template Roles Batcher Lets you add or remove access permissions, for multiple roles and multiple templates at once. User Roles Permissions Batcher Lets you add or remove permissions for multiple roles, or roles for multiple users at once. Creating a New Action If you create a new action that you think others would find useful, please add it to the actions subfolder of this module and submit a PR. If you think it is only useful for you, place it in /site/templates/AdminActions/ so that it doesn't get lost on module updates. A new action file can be as simple as this: <?php namespace ProcessWire; class UnpublishAboutPage extends ProcessAdminActions { protected function executeAction() { $p = $this->pages->get('/about/'); $p->addStatus(Page::statusUnpublished); $p->save(); return true; } } Each action: class must extend "ProcessAdminActions" and the filename must match the class name and end in ".action.php" like: UnpublishAboutPage.action.php the action method must be: executeAction() As you can see there are only a few lines needed to wrap the actual API call, so it's really worth the small extra effort to make an action. Obviously that example action is not very useful. Here is another more useful one that is included with the module. It includes $description, $notes, and $author variables which are used in the module table selector interface. It also makes use of the defineOptions() method which builds the input fields used to gather the required options before running the action. <?php namespace ProcessWire; class DeleteUnusedFields extends ProcessAdminActions { protected $description = 'Deletes fields that are not used by any templates.'; protected $notes = 'Shows a list of unused fields with checkboxes to select those to delete.'; protected $author = 'Adrian Jones'; protected $authorLinks = array( 'pwforum' => '985-adrian', 'pwdirectory' => 'adrian-jones', 'github' => 'adrianbj', ); protected function defineOptions() { $fieldOptions = array(); foreach($this->fields as $field) { if ($field->flags & Field::flagSystem || $field->flags & Field::flagPermanent) continue; if(count($field->getFieldgroups()) === 0) $fieldOptions[$field->id] = $field->label ? $field->label . ' (' . $field->name . ')' : $field->name; } return array( array( 'name' => 'fields', 'label' => 'Fields', 'description' => 'Select the fields you want to delete', 'notes' => 'Note that all fields listed are not used by any templates and should therefore be safe to delete', 'type' => 'checkboxes', 'options' => $fieldOptions, 'required' => true ) ); } protected function executeAction($options) { $count = 0; foreach($options['fields'] as $field) { $f = $this->fields->get($field); $this->fields->delete($f); $count++; } $this->successMessage = $count . ' field' . _n('', 's', $count) . ' ' . _n('was', 'were', $count) . ' successfully deleted'; return true; } } This defineOptions() method builds input fields that look like this: Finally we use $options array in the executeAction() method to get the values entered into those options fields to run the API script to remove the checked fields. There is one additional method that I didn't outline called: checkRequirements() - you can see it in action in the PageTableToRepeaterMatrix action. You can use this to prevent the action from running if certain requirements are not met. At the end of the executeAction() method you can populate $this->successMessage, or $this->failureMessage which will be returned after the action has finished. Populating options via URL parameters You can also populate the option parameters via URL parameters. You should split multiple values with a “|” character. You can either just pre-populate options: http://mysite.dev/processwire/setup/admin-actions/options?action=TemplateFieldsBatcher&templates=29|56&fields=219&addOrRemove=add or you can execute immediately: http://mysite.dev/processwire/setup/admin-actions/execute?action=TemplateFieldsBatcher&templates=29|56&fields=219&addOrRemove=add Note the “options” vs “execute” as the last path before the parameters. Automatic Backup / Restore Before any action is executed, a full database backup is automatically made. You have a few options to run a restore if needed: Follow the Restore link that is presented after an action completes Use the "Restore" submenu: Setup > Admin Actions > Restore Move the restoredb.php file from the /site/assets/cache/AdminActions/ folder to the root of your site and load in the browser Manually restore using the AdminActionsBackup.sql file in the /site/assets/cache/AdminActions/ folder I think all these features make it very easy to create custom admin data manipulation methods that can be shared with others and executed using a simple interface without needing to build a full Process Module custom interface from scratch. I also hope it will reduce the barriers for new ProcessWire users to create custom admin functionality. Please let me know what you think, especially if you have ideas for improving the interface, or the way actions are defined.1 point
-
Since I was stuck to my flat today I took up a wish and rolled a Process module / CKEditor plugin combo that adds @-autocomplete like the mentions here in the forum to CKEditor fields. It's configurable, but only in module settings for now, the positioning of the select list is quite off and there's still some visual work to be done, so it is in early alpha state. Nonetheless, if you want to take a look, here it is: https://github.com/BitPoet/ProcessMention After installation, you may want to look into the "Additional selector" entry in the module's settings. You will most likely want to limit results to certain templates there. Edit: Updated to version 0.0.30 with fixed positioning of the dropdown. Edit2: Settings are configurable in field context now. If pwmentions is enabled, the according settings are shown on the "Input" tab.1 point
-
Hi, I am not sure if it is the right forum to ask this question. If not, please move it to the appropriate forum. I would like to build a Progressive web app with Processwire as the backend to serve content to the web app. Is it possible? If so, what is needed? Any ideas and suggestions are welcome. Gideon1 point
-
@godmok, @szabesz and @mel47 - could you please try the latest version on the dev branch. I had to rejig a few things to get this new version to also work with Form Builder. @mel47 - please read my previous post above regarding the breaking changes in this new version. I'll be making this the master version once I have confirmation from you guys that you aren't seeing any problems. I don't like introducing breaking changes, but in this case it was necessary to allow more flexibility for calling custom outputs via the API. Thanks!1 point
-
What you describe here is far, far away from what can be expected in a somewhat "normal" server / hosting setup. If you can share a link to such pages, we could have a look at it. Or you could do this yourself - open the same page you opened as PW admin in FF/Chrome "anonymous mode". You mentioned that IMagick is not allowed/installed on your server. Are you aware of any other server-side restrictions? Can you define custom settings via .htaccess, php.ini, user.ini or in php files with ini_set()? I'm afraid someone else has to look into this (relatively new) method and check if there are options...1 point
-
Hi, The "Form Builder Support" forum is the best place for help. If you don't have access to it yet, you can normally ask @ryan to activate it if you have a license/licence. @thmsnhl Edit: "...the support and upgrades period lasts for 1-year..." and " After 1-year, you can optionally renew your access to the support/upgrades board for a nominal fee..." (depending on your license level).1 point
-
@StanLindsey I think making a PWA without a backend is not hard. There are so many tutorials and examples. Agree. Thanks for the advice and encouragement. Gideon1 point
-
1 point
-
Look here, there is complete upgrade procedure with help: Thanks for chiming in @horst - I have already linked to that: This is the problem with multiple threads for the same issue, but I think @Oca2 has the message on that now1 point
-
I remember you mentioning this in the FB subforum and it's a nifty solution. In terms of letting editors add the repeatable field, you could bundle the bits into a custom inputfield module and then include it in the types allowed for FormBuilder.1 point
-
1 point
-
I like the site. The only thing is the contrast between the text and background, eg, the menu and related pages, is not high enough for my old eyes. Otherwise, do they deliver to Texas?1 point
-
still getting strange pages turn up and not even as childs of the page containing the repeater... very strange. I'm on 2.8.62 and the dev site on 3.? and its not happening on dev, so maybe an update will fix it.1 point
-
1 point
-
Support for progressive JPGs is integrated into the Dev version. I think it is there since 3.0.80, but don't know exactly. To use it put this into your site/config.php $config->imageSizerOptions('interlace', true);1 point
-
I've never really built a progressive web app, so this answer may be silly. Not having experience with them, I only know the basics, and am not aware of the best practices. Disclaimer out of the way, Processwire's best feature is the flexibility of what you can make with it. I've made web-apps that mimic the look and feel of an actual app, and I've made single-page web applications that load content through Ajax calls. You can very easily set up a page template that grabs content of the POST variables, does its thing and outputs whatever you want, be it JSON, XML or just a chunk of HTML to feed into a <DIV>. If your frontend is able to read that output and display it, you're good to go.1 point
-
This is the most important thing to me. If we keep having these conversations then let us solve the root cause. How can we as a community help Ryan more? We need Ryan to help us create some frameworks and models for us to help him out. As there is a barrier of entry for us to help him. This framework can then be used for us to achieve whatever we need to (be it website, documentation, pro modules etc), with a sense of direction.1 point
-
See the explanation at https://processwire.com/blog/posts/hello-pw3/#new-github-repositories If Ryan would only be the manager, he would be bored, I think. He just loves to code We've had this sort of conversation multiple times. I believe we all would love to help but we just don't exactly know how.1 point
-
@prestoav, @noelboss I also wanted a PayWhirl API for ProcessWire so just went ahead a built one. It's basic - simply a PW wrapper for the PayWhirl API but should be OK. Biggest gotcha I discovered was that at present, you need a paid PayWhirl account - not the freebie one. You could ask PayWhirl to grant access to your free account for development purposes... Will let you know their answer to my request for same.1 point
-
Theres a CMS voting on a known german website: https://www.drweb.de/welches-cms-verwendest-web-projekte/ And the interesting part: 5th Place in the ranking is very nice and theres a planned test of processwire on drweb.de 1. WordPress 2. Typo3 3. Joomla 4. Contao 5. Processwire 6. Drupal1 point
-
Oh how I love my country. Just came home from a night out with the wife, a nice dinner followed by a glass of Macallan on a terrace. A jacket and scarf with just a shirt underneath is enough. Got home, all the heating we have is a couple of cats and a gas heater for when it's really cold (by our standards), which is turned off, but temperature is perfectly fine. This while the US is going through an ice age and people are getting blown away by the wind in the Netherlands. And after I click "Submit Reply", I'm going to change into a t-shirt, fill up a hot water bottle and go to bed, feeling blessed.1 point
-
My bad. The documentation is wrong. I like to use immutable objects so I created a getter function for the enries: getEntries() The readme is now updated.1 point
-
Hey thmsnhl, I'm using ProcessWire for a few projects at work as well as for my personal projects. Originally coming from Ruby On Rails I also encountered problems with our database synchronization when it comes to team development on a single project. Depending on the project we solved this using Field/Template Export/Import while also only working on certain parts of the page. Most projects are already finished in terms of template/field structure so there is no need to have an always up-to-date local database snapshot. If the project is not finished in terms of template/field structure we usually sit together and draft a "this-solves-everything"-kind of template/field and synchronize this to our local databases once and then just code ahead. Other frameworks solve this by using Migrations and although ProcessWire does not support Migrations in the core (as of now) you can use this module: https://modules.processwire.com/modules/migrations/ (Here are a few code samples and documentation: https://lostkobrakai.github.io/Migrations/). This module does not directly add tables and columns to the database like RoR migrations do but instead allows you to do nearly everything you can do in the Admin UI using code. You can for example create templates, move fields around, install modules, setup users etc. It can be a bit tedious at first to learn all the new APIs this module offers but the benefits, especially for large projects, speak for themselves. These migrations can be safely checked into your git repository and whenever one of your teammates encounters a problem with his out-to-date database he can simply run the migrations files. So instead of adding templates and fields on production you write them in code and deploy your changes to production, then you migrate either using the CLI utility or the admin backend. You can also integrate this into your build toolchain (like Amazon CodeStar). Check this code example I bet it feels quite familiar: <?php class Migration_2018_01_16_12_32 extends Migration { public static $description = "Add postalcode to a hotel"; public function update() { $this->insertIntoTemplate('hotel', 'postalcode', 'title'); $this->editInTemplateContext('home', 'postalcode', function($f){ $f->label = "Hotel Postalcode"; $f->columnWidth = 50; }); } public function downgrade() { $t = $this->templates->get('hotel'); $t->fieldgroup->remove('postalcode'); $t->fieldgroup->save(); } } This adds a `postalcode` field right after the title field to the hotel template. And it removes this field when you rollback your migration. This is how we tackle this problem.1 point
-
Can't believe I discovered this awesome module only recently... I mean, it's over 2 years old now already Here's another use-case:1 point
-
Thought id also post a link to this great blog post by Ryan, which includes the successor to the MarkupLoadGCal module: https://processwire.com/blog/posts/composer-google-calendars-and-processwire/ Hope this helps.1 point
-
Here are a few links to check out for PW calendars. I'm not recommending a solution here, just signposting. These are in the official PW module repository... https://github.com/ffub/MarkupiCalendar (iCalendar feeds anyone?) https://github.com/netcarver/PW-ProcessGcalEmbed (My old module) http://www.99lime.com/modules/recurme/ (Premium) These aren't (a.f.a.i.k.)... https://github.com/plauclair/Calendar https://github.com/ryancramerdesign/MarkupLoadGCal (Ryan's module) https://github.com/decadeofdefeat/church-website-processwire (Has a calendar implementation in it) https://github.com/lindquist/processwire-calendar https://github.com/UF-Asq-Fab-Lab/Scheduler Hope that helps!1 point
-
1 point
-
Hi @Sérgio Jardim, Does it still work without issues on PW 3.x? I'm not a fan of modules not maintained anymore but this one sounds really interesting. I wish @ryan at least added namespace support and assured us that it will work with future ProcessWire versions as well. IftRunner is not even in the Module Directory.1 point
-
Hi @mvdesign. So sorry that I could not respond earlier. I decided to make an introduction video for this module to help people that are trying to use it. But then, I never made a screencast video before, and on top of that, the last time I spoke english was 2011. So I had to take dozens of try-outs till I got something watchable. So here is the video. It shows how you would create/update pages with this module. The video is far from OK, so I will probably record another one after I get some feedback. Until then please refer to this video to learn about how the module works.1 point
-
@tpr - glad it works and that Migrator helped to save your *ss too Firstly, I do have a working solution for you, but first a little background It is weird that nothing is getting exported - it is definitely exporting a valid CSV file for me. The only problem I am seeing is that I can't control the fields that are exported - it is defaulting to: Set Password, Email Address, Roles The problem is that if you allow the Home > Admin > Access > Users to be separately configurable you should be able to specify the required fields, but the settings don't save, because that page is locked for editing by PW so we are out of luck with that. BUT, here is my working solution, which I think is cleaner than making users navigate to that deep page anyway: Grab the latest master version (there is one critical change to make this work). Create a new page somewhere in the main page tree (not inside the Admin tree) - maybe called "User CSV Export". Make this new page separately configurable in the BCE "Where editing tools are available and separately configurable" settings section. Go to the Settings tab of this new page and configure it to enable Export mode. In the Content / Deletion / Protection section, set the Parent Page to: Home > Admin > Access > Users In the CSV Export Settings, set up the fields to export. You will likely want Name, Email Address, and any custom fields you may have set up. Save settings and then go to where you have BCE displayed (maybe an Inline Fieldset would be a good idea in this case) and click Export. Works great here, so please test and let me know.1 point