Leaderboard
Popular Content
Showing content with the highest reputation on 01/08/2019 in all areas
-
This is what I have so far (very early state, please do not pay attention to the column values) I have decided to use ProcessWire modules wherever possible. I also want to avoid dependency on third-party modules - there are so many out there which are abandoned or no longer supported. The grid in the screenshot is an MarkupAdminDataTable combined with parts of a PageLister. As this will be a live-view, where you can watch your mailings flying out, I'll refresh part of the columns via Ajax. As I said, we have already developed a very powerful multiprocessing sending engine for the mailing module. So we are good to go here. In general, I'd like to orient the Module as closely as possible to the ProcessWire look and feel and paradigm. The UIKit Admin Theme will be primarily supported.6 points
-
To implement that is quite simple, check this small starting point, it should give you the idea :6 points
-
I think the site is a huge step forward. Nice work ? IMHO it should go live ASAP and changes and bug fixes could be streamed in incrementally My main points would be: Text It seems 'wordier' that the current site. On almost every page I'm hit with a wall of text. We should have more screenshots on internal pages. Screenshots I think we've lost something with the wall of text and more emphasis should be put on the screenshots. I think you should loose the iMac mockup and replace with a simple collection of 10 or so screenshots which a user can cycle through. None of my clients has ever tried PW based on a description of the CMS. In contrast, almost every one has been an instant fan of the simplicity of the UI. I've had clients who were new to PW fire up the initial tree view and become instant fans. I think the essential simplicity of ProcessWire has been lost in an effort to describe ProcessWire. Pictures and 1,000 words and all that etc... Video One of the things that attracted me to PW was Ryan's video where he spoke about the CMS and what it means / stands for. It was sincere, clear and honest without hyperbole. I just rewatched it and it's still a very compelling piece of video and 100% of what is said is still relevant. Of course the screengrabs are out-dated but that didn't stop me exploring PW and diving in at the time. Is it worth including this and later on re-doing it? Edit: I found the video on the new site ? API examples This is subjective but I'd rather the API samples were a little more user-friendly in tone and presentation. An example I like is on Stripe.com https://stripe.com/ie If you scroll down the the section 'Developers First' they have a lighter background and a nice way to flick between the different methods Zooming text That's the only part I'd 100% change. It's too gimmicky for my tastes. But seriously - good work. ?5 points
-
Even if is just the frame of an iMac I still feel it's very ugly and not representative of what is Pw. Moreover that image is the first thing a newcomer will notice on the homepage and it does not explain nor give credit to the quality pw deserves. Sorry if I'm a bit rough and direct, it's just because I really care about the project ? What about something like this, where a simple and not recognisable osx frame serve as a placeholder for our purpose? I still strongly believe that it's not important to show inisde that frame a 1:1 rapresentation of the backend, instead it could be used to show a sneak peek of the api, where some code is presented and act as an immediate hook for the visitor.5 points
-
$this->addHookAfter('ProcessTemplate::buildEditForm', function ($event) { $form = $event->return; $template = $event->arguments[0]; $icon_field = $form->find('name=pageLabelIcon')->first(); $icon_field->collapsed = Inputfield::collapsedHidden; $field = $this->modules->get('InputfieldText'); $field->attr('id+name', 'template_emoji'); $field->icon = 'list-ol'; $field->attr('value', $template->template_emoji); $field->columnWidth = 100; $form->insertAfter($field, $icon_field); $event->return = $form; }); $this->addHookBefore('ProcessTemplate::executeSave', function ($event) { $template = $this->templates->get($this->input->post->id); $template->set('template_emoji', $this->input->post->template_emoji); }); $this->addHookAfter('ProcessPageListRender::getPageLabel', function ($event) { $page = $event->arguments('page'); $template = $page->template; if($template->template_emoji) { $event->return = $template->template_emoji . ' ' . $event->return; } });5 points
-
Hey Ryan - thanks for all of today's changes - it's really coming along! A few more thoughts: 1. On the core download page (http://processwire.com/newsite/download/core/) in the right sidebar, the grab.pw link directly downloads the master.zip file. I don't think users will expect that - they will expect to visit a grab.pw website. Maybe it's just me, but the distinction between grab.pw and www.grab.pw is pretty weird. Also, does anyone ever use these links? Honest question because I have never thought of using them and I am not sure that they offer any real value - just seems a little like unnecessary and confusing options. 2. We have a LOT of different install options with the bitnami etc, soma install and even @bernhard's https://processwire.com/talk/topic/18166-processwire-kickstart/ 3. There seems to be a bug when clicking on the close button for the live search - probably best shown by a screencast - see how closing it temporarily shows the menu, but then the search box comes straight back again. 4. I'd love to see the ESC key not just clear the live search text, but also remove the search box and display the menu again. Even though you improved it by hiding it when un-focusing it, I think this would also help - I know I use the ESC key a lot for stuff like this. 5. In response to my earlier comment about linking to the Github repo for your Upgrades module, on https://processwire.com/newsite/about/what/#easy-to-upgrade you point to the modules directory, so there is a lack of consistency here. 6. On the https://processwire.com/newsite/docs/fields/repeaters/ page you state "When you edit a repeater field in your page, you edit all items at once. Is this necessarily true now that repeaters have ajax loading? I know the point is to discourage use of repeaters when there will be too many items which I agree with, but I wonder is that statement is still maybe a little confusing. 7. Also on the https://processwire.com/newsite/docs/fields/repeaters/ page you have two links to "PageArray" which are absolute URLs so they currently go to: https://processwire.com/api/arrays/page/ instead of https://processwire.com/newsite/api/ref/page-array/ 8. I couldn't find any docs for field templates that you described here: https://processwire.com/blog/posts/more-repeaters-repeater-matrix-and-new-field-rendering/#processwire-3.0.5-introduces-field-rendering-with-template-files - is this somewhere in the new docs that I missed? I think that's all for this round ? Keep up the great work!4 points
-
This is still available at: http://processwire.com/newsite/about/background/ Also, regarding your link to the Stripe site - I really like their Runkit code sandbox. This might actually be a good example of how the Tracy Console could be included - actually embedded into a page, rather than as a Debug bar panel. I think this really helps to get devs engaged and seeing just how easy and powerful the API is.3 points
-
It's not that simple - pages under Admin > Setup need to have the "admin" template and they need to have a process assigned to them. Creating a process module is probably what you are looking to do. Check out @bernhard's blog post tutorial: https://processwire.com/blog/posts/building-custom-admin-pages-with-process-modules/3 points
-
Implementing a basic support for additional webP format in PW is just around the corner, (when I next get time to do the implementation in IMagick. In GD is already working.) ?3 points
-
Ryan - I think this is really important!!! Earlier (https://processwire.com/talk/topic/20596-new-post-new-pw-website-ready/?do=findComment&comment=178332) I mentioned all the different ways to get $page that are listed on the variables page - turns out there is of course another $wire->pages which you don't mention there, but you do mention on the bootstrap page. I am not sure how to best clean this all up, but I think it makes things very confusing. Perhaps the entire website should stick with "$page" etc in all examples and wording, but then there is one dedicated page that explains what version can be used when/where and the pros and cons of each.3 points
-
@horst If already working in GD, what's necessary to make it work with the core? Or are you saying the ImageSizerEngineGD in the core already supports it? Admittedly I've not had much experience with webp but interested. Btw, how does the Barlow font version render over there? @jmartsch I enabled permanent scrollbars here and now I'm seeing it. I applied a few adjustments that seem to fix it and will push those updates later today. This is the way it has always worked (it did not change with the new site). However, I really have no idea of anyone is using it or not. I might disable it and see if anyone says "hey what happened?" Thanks I fixed it locally and will push the update later today. I don't immediately know how to implement ESC key here but will revisit it later. I think this is what I was feeling too (with Work Sans), there is kind of a typewriter feel going on. I still like it, but just thinking it's not the right fit here. I like Krub better than any others I've seen so far, but if it's got rendering issues then we'd need to determine if the issue is reproducible beyond Horst's computer, which I'm guessing it is, though have not yet heard any other reports. Barlow then Rubik are the other two that I think could do the job. I don't expect it to work with all links, it's just a quick-n-dirty way for us to see different fonts/colors. But it's not going to be retained as a feature of the site. It looks to me like an iPad, which doesn't speak to a development environment for me. Though maybe people are using them that way, I don't really know. But the goal with the frame was just to give the appearance of looking over the shoulder of someone's development and editing environment. While just a browser frame (or some other OS frame) is kind of what I expect to see here, anonymous, so I'd just tune it out. It lacks context of a dev environment that I think is needed here. It's got to be something that implies we're looking at the whole screen of an actual computer of a web developer, not just a window. I also don't want to show an iPad (or any tablet or phone) because that isn't representative of an dev environment, plus it implies something to do with mobile, which isn't a message we're trying to get across here. While we'll start with the current frame, I also see it as a short term thing. I personally like the current setup but I know it's also subjective. Regardless of subjectivity, I think it communicates what needs to be, and that's what I'm focused on rather than whether people think an iMac is ugly or pretty. But an actual video is the end goal, and this needs no frame. I'd like to replace it with that video Jonathan was working on, once that's at a good point (and if he's open to it).2 points
-
I'll support both methods (probably "sending via server" in the first place).2 points
-
Really overwhelmed by the incredible efforts by you, @ryan, and the community! Many thanks! My two cents on colors and contrast: Making the blue background darker would increase the readability of the white text on it (and of the h3/h4 headlines on white) - and it would reduce the irritation on totally blue pages like the blog. I'd propose https://processwire.com/newsite/?color=1155DD. And, please: Make the body color darker, say #333333. Reading text with too low contrast ist very tiring. Two more remarks: I like the font "Krub" - it's looking fresh and modern, like PW is - whereas the font "Work" looks oldfashioned to me. But of course, if a font is not rendered well on some platforms, it's not an option. I'm not sure you should show an image of the iMac (despite the pride owning one...). At least I would remove the foot of it, so it's brand is a bit less obvious. Again: Thanks and compliments!2 points
-
Hey @Mike Rockett ? Have you somewhere your re-design mockups posted almost exactly 2 years ago? I remember they were very well crafted and appreciated by all of us, especially the lighter version. Does anyone remember them? Maybe we could visually iterate over those in order to point the new website in the right and smarter direction, I'd love to hear some kind of feedback about it.2 points
-
Under MODX my Newsletter Add-On manages all mailings in its own resource containers. This is comparable to a PW page, which serves as a container for subpages. My newsletter module GroupMailer will also provide an administration console where you can start, stop and generally manage mailings + allows you to watch the sending status. What would you recommend as an experienced PW user? How should the mailings be managed in the PW module? I want to follow the PW paradigms as much as possible and also offer the greatest possible flexibility. Here is a screenshot from the MODX version: Greetings, and a Happy New Year! Martin1 point
-
@ryan here is a screenshot with barlow font. Looking good here, (not best but good!) https://biriba.de/pw_pop3/Screenshot_2019-01-08.png Regarding webP, we have had discussions in the forums and at github, plus I have built it into GD already for basic usage. With the current version here, you can add an additional param with the images calls to additionally create a webP image besides the requested variation. With two hooks I'm already using it in test sites: hasWebp and urlWebp. In my markup generation for picture elements (or srcset), if hasWebp is true, I generate alternative webP image src for browsers that do support it. The other cool thing (what I not have tried yet, but should become my favourite usage) is to use it with the lazyload class, that already includes checking for webP alternatives via JS, when enabled. So the only thing to do is to create the webP format besides the requested image. I had planned to finish this during the holidays, but then got two jobs with one deadline 29.12.18 and the other has to be finished this tomorrow. (uff) Here are the links to the discussions: https://github.com/processwire/processwire-requests/issues/1#issuecomment-443164642 https://processwire.com/talk/topic/14236-webp-support/?tab=comments#comment-176944 https://processwire.com/talk/topic/14236-webp-support/?tab=comments#comment-1776301 point
-
That seems to be the best solution. Here is the code for the ProcessSettings module: <?php namespace ProcessWire; /** * Settings Module * ProcessWire 3.x, Copyright 2018 by Ryan Cramer * https://processwire.com * */ class ProcessSettings extends Process { public static function getModuleInfo() { return array( 'title' => 'Settings', 'version' => "1.0.0", 'summary' => "Modify site settings", 'permission' => 'settings-view', 'singular' => false, 'autoload' => false, 'author' => "PWaddict", 'icon' => 'cog', 'page' => array( 'name' => 'settings', 'parent' => 'setup', 'title' => 'Settings' ) ); } public function execute() { $settings = $this->pages->get("template=settings"); $this->session->redirect($this->wire('config')->urls->admin.'page/edit/?id='.$settings->id, false); // false = 302 temporary redirect } } and with my HidePages module I hide the Settings page from the Pages tree for non-superusers so they can only access it from Setup menu.1 point
-
As far as I know, it's not possible to use a repeater field in a Process module. A repeater is necessarily a combination of fieldtype and inputfield whereas a Process module can only contain inputfields.1 point
-
Thanks for the heads up on that @Macrura - it shouldn't be an issue in the latest version just committed.1 point
-
I'm attempting to upgrade a site from 2.7.x to 3x, and one of the modules that i'm upgrading also is Tracy. One major issue that anyone doing this upgrade will encounter is the legacy setting for coreBranch – if that is set on your initial install, then it will be stuck in 'stable' and cause require_once failed to open stream errors on tracy-stable/src.tracy.php; the 2 ways to fix this are to either first just completely uninstall Tracy before upgrading, or to manually change that value in the database.1 point
-
If you give the search input an id of "livesearch", then this works: document.getElementById('livesearch').addEventListener('keydown', function(e){ if((e.key=='Escape'||e.key=='Esc'||e.keyCode==27)){ e.preventDefault(); document.getElementById('livesearch').blur(); } }, true); Maybe could be improved?1 point
-
An observation: The title of the newsite homepage is An open source CMS with a powerful API: ProcessWire CMS while it was ProcessWire CMS: An open source CMS with a powerful API before. Given that bookmark lists are using the titles (which often get truncated) the latter version should be kept.1 point
-
1 point
-
Sure, I'll setup on WireMail class so we can use all available extensions and services. And it can be "easily" extended.1 point
-
1 point
-
Client side is fine for not so long running tasks. But for queus that take longer you might not want to sit and wait until they're finsished. So I guess server side is the way to go here. Great!1 point
-
RockGrid has this built in, so it would be a lot easier to just use RockGrid instead of using DataTables + Queue. Only difference is that horsts queue works on the server side and RockGrid batcher works on the client side. Sending emails is another interesting decision to take: do you want to send them via the server or via a transactional service? This would need different implementations..1 point
-
Hello all, I am currently developing a process module that will create 2 templates and add pages to the page tree that are then being displayed within the module. I'd like to use existing fields for the templates instead of creating my own where possible and have the code for template and page creation inside the install method. Is there a way to let the user choose module options (in my case fields from a select dropdown) before the module is even installed? Is there a generic PW way to go about this?1 point
-
No, I saw this method and tried it beside running it normally. Both ways are slow. Have some WordPress sites with a similar Docker setup and everything goes well. I just updated my local dev environment (outside Docker) and copied the files and DB and it works nice and fast. So, I don't know why, but it seems to be related to Docker. But I am wondering why, since my Mac has good specs and WordPress runs smoothly, though haven't dockerized any other CMS. Will investigate a little further and keep you updated.1 point
-
maybe still a little early to think properly but in this case, instead writing the logic on the __install() method itself, you could present a ProcessModule where in the first instance, the user choose what's needed then he click on the button "Proceed to install". Or another way could be to present a standard template/page with a Hook which install the module on Page::save. I think you get what I mean.1 point
-
Great to see a Gov Department here is Australia go away from Drupal and go with PW! Good work guys! I left Drupal in 2013 for PW and have never looked back.1 point
-
Sorry, I wasn't clear, I meant, when you select a different brand than was already saved and add a new model at the same time, the hook won't work because it's attempting to create a new page (model) under the old brand and not the newly selected brand. In other words, changing both brand and model at the same time breaks the hook.1 point
-
@Robin S Here's Work Sans: https://processwire.com/newsite/?font=work This is one of those fonts that I do agree with you is very nice, but it seems like it works in some places and not others. I think it's the width combined with some of the details that is giving me trouble, especially at body copy sizes. Or maybe it could be that it's just so different that I'm not used to it. @teppo I am using a retina screens, both on my aging MBP and 27 iMac. However, my eyes are not so good, so I simply can't see anything if I use the scaled down resolutions. ? I have to use the default res (2560x1440 on the iMac). Not seeing the artifacts myself, but I know they are there, as I definitely saw them when I exported them in Photoshop. But the scaling them to 50% down (for hidpi) must have taken care of that. If using screen at native resolution (non-hidpi) I can see how the artifacts would show. I'll try re-exporting these. Making them PNGs doubles the size, but I think that's okay because I'm actually lazy loading these 1-by-1 as they display, so it's not slowing the initial page load. @horst thanks for reporting back on the fonts! Good to know some of them render well. Good to hear about the 110% thing being the cause of the dropdown issue. Though I have no idea how to fix that. I might have to switch up the order so that one of the items without a dropdown displays last.1 point
-
Nope jQuery (the third party JavaScript library) isn't added by the module. Try to add this piece of code just after the footer then refresh your page : <script src="https://code.jquery.com/jquery-3.3.1.js" crossorigin="anonymous"></script>1 point
-
Thanks – I can see definite improvements already, and we can surely keep improving things after the initial launch as well! Regarding the target group I get what you're saying, but it's good to keep in mind that improved accessibility actually benefits us all – it's not (just) about catering for users with disabilities ? "While accessibility focuses on people with disabilities, many accessibility requirements also improve usability for everyone. Accessibility especially benefits people without disabilities who are in limiting situations, such as using the web on a mobile phone when visual attention is elsewhere, in bright sunlight, in a dark room, in a quiet environment, in a noisy environment, and in an emergency." (W3C WAI) My eyesight is way below average, and I can see a lot of artefacts and other signs of low quality in there. Just checking, but do you have a retina screen? Could be somehow related to resolution as well – I've got a 15" MacBook Pro with resolution set to "scaled" and "more space" set to the maximum value.1 point
-
Just a note about fonts. Maybe we should consider fonts with the Cyrillic glyphs support? In the longer term, there probably maybe some messages on the forum or even parts of documentation translation in Ukrainian or Russian languages. Without Cyrillic glyphs, this parts will fallback to another font and it will look not consistent with other parts.1 point
-
Great work Ryan, thank you! I fully agree with this. Our main use of Processwire is as a headless CMS / CMF for Single Page Applications. As a possible future user I would be very interested in learning about how PW can be used in this way. I would look for that on the 'Output' page (https://processwire.com/newsite/docs/front-end/output/). A simple JSON API example, without the use of any external modules, would suffice here I think.1 point
-
1 point
-
Love it! The only thing I'm not sure about is the emphasis on... I feel that a low maintenance overhead is already strongly implied by reliability and security sections. I like to run updates if only to keep the CK Editor plugin up-to-date, which *does* have semi-regular security patches. It might not appeal to developers for whom updates are bread and butter. I'd rather see something like... Lower maintenance costs, because security, reliability, and a stable API resulting in painless upgrades. Yeah, I once did a major version PW upgrade on a fairly complex 30,000+ page site and *nothing* broke! Zero. Zilch. Nada. It brought tears to my eyes. A lack of breakage that is unheard of in CMS land. Compare with regular minor version breakage for some other CMS ?1 point
-
Nice work ! What a refresh ! ? As two-cents frontend dev, I think that the Download and Demo buttons on the start page could deserve a "better" ghost-button. Additionally, on the "Demo" button, I would see a 'bolt' icon more than a 'map-marker' (the 'rocket' icon should be perfect but not integrated in the UIKit framework I think). This ! Those last years, despite every module being a gift for the community, Tracy has become THE tool to build those gifts. It is also THE tool for peoples who like to offer support for free to the community. And without speaking about support or modules dev. but globally, the experienced or newbies developers, once they get their hand on Tracy, they speed up their development workflow. Just to say that @adrian made a crazy job with Tracy and it give to ProcessWire more strength (than it already have), so yes, definitively yes ☝️1 point
-
Thanks to those who noticed the 404 happening on the Jobs site. I've been on my Christmas break, hence the lack of response from me on the AAD Web Team forum account. We had some wider network issues going on which were out of the web team's hands, but the right people were aware of it and worked hard to get things going again. ?1 point
-
If you’d like my unadulterated perspective: I think the way PW is communicated is too verbose and complicated. The concept of Pages doesn’t make this any easier. It’s almost like that term has outlived what the product has become known for: power a website or something altogether different. Just look at the Pages overview and you see how it could be totally perplexing to a newbie. Words have meaning and sometimes wisdom requires rethinking how we communicate. Despite being new—having built three or four websites with it—I love this product and hope more people come to appreciate what Ryan has built.1 point
-
Great work @ryan! A really nice fresh new look. I especially love the little fine details of all the wires and plugs. I also like all the little testimonials scattered everywhere which relate to the content above them. Just two little things I noticed that were not mentioned yet. When in a sub category of the About menu, the navigation menu displayed on the left appears for each item except for 'Reviews' page. The top menu has the same flow and look regarding the plug and circle for items 'About', 'Download' and 'Docs', but the others don't. The plug and circle when on the 'Docs' page, using a widescreen monitor, the circle is outside the cord or overlapping the plug, depending on the width of the viewers monitor. I can't believe so much has been done in such a short amount of time though, great work!1 point
-
@ryan, the site is beautyful in so many details! I directly fallen in love with those little wire-loops and plugs etc. ? ! I will have some more in depth looks next week, as I have to work this weekend. Only one thing I want to show you know: Unfortunately the fonts render very bad on my machine, win7 firefox 64. I'm aware that it do not render that bad on all win7 machines, but I'm also not aware of any special settings regarding fonts rendering on my machine. I setup my system completly new from scratch last year, and I left the most things by default settings where applicable, (to reduce time with the setup, as I have to change in 2019). There are, maybe 15% webfonts in websites that behaves like this one too. (?) A 1:1 PNG screenshot is uploaded here, so that it doesn't get rendered through a forums image engine. Please look at it in 100% scale. https://biriba.de/pw_pop3/new-pw-site---fonts-rendering-ugly-win7-ff64.png1 point
-
Yes, there are many browser extensions that will let you do this, but we want something that can be shared and viewed easily by others via a link. Sounds perfect, will check it out. Update: I made my own tool...1 point
-
Looking good Ryan. One thing I noticed is the last dropdown menu "Docs" should open the same direction/way as the "Download" menu item but it doesn't. It opens off screen causing horizontal scrollbars. When viewing on Chrome. Edit: it looks like jmartsch beat me to it. Please consider giving the light grey and other muted text more contrast for accessibility. See https://contrastrebellion.com/ for humor. #666 for body copy gives AA, but #565656 gives AAA for example. Chrome's inspector now includes a contrast accessibility checker when you click on the color swatch/square. The curved line represents what passes the AA or AAA rating. After reading the API examples, I want to know more about it. I think we need a link or outlined button below the examples "Get started with the API" or "Learn more" so they can continue reading. Now that I look at it more, maybe each homepage section needs it own call to action button below. At first it wasn't entirely obvious that the headers on the homepage were links. Ex. Blog posts - might need a button below that say's "View all" or something similar. Same for the Processwire Showcase and Shop. - This might actually motivate new users to join the forums as well. Those are just a few of the first things that come to mind when viewing the site. Hope that helps1 point
-
Hey, does anyone know a web service that will load a website in an iframe or similar wrapper with custom CSS applied? So that the community can try out some alternative styling ideas for the new website design and share them here in a way that others can see directly in their browser rather than as static screenshots. I'm sure there used to be some tools that did this but after looking I can't find any working ones. The two I did find are only for font changes, and both seem to be broken for me: Typewonder - very basic (cannot target different fonts for headings or using custom selector), share function seems to be broken. http://typewonder.com/home Webfonter - only for FontShop fonts, also seems to be broken (font thumbnails fail to load and fonts do not update). http://webfonter.fontshop.com/ Anyone know of something better, ideally that will add any kind of custom CSS and not just font-face changes?1 point
-
RockGrid is perfect for such scenarios: You get nice, condensed, sortable, paginated tables You can style cells easily (like statuses for sent, pending, draft etc) You have a batcher built in, making it possible to send x mails at a time, running via AJAX so you don't get server timeouts The main reason why I released it under the MIT license was that it can be built into other modules easily. That would be a process module and MarkupAdminDataTable and LOTS of custom code...1 point
-
Here is a new created version to track changes which works without any problems and you dont have to take care about the deletion of input values if the page was not saved successfully (like in the version before) Put this little piece of code inside your ready.php. //Compare before and after values and output a warning message $pages->addHookAfter('Pages::saveReady', function($event) { $page = $event->arguments('page'); $page->of(false); //configuration: change it to your needs $templates = ['event_businessvacations', 'event_dates', 'event_events', 'event_specialbusinesshours']; //array of templates where this hook should run $fields = ['summary', 'body']; //array of fields which should be checked //configuration end if(in_array($page->template->name, $templates)){ $changedfields = []; foreach($fields as $fieldname){ if ($page->isChanged($fieldname)) { // Page as it is in the DB $oldPage = wire('pages')->getById($page->id, array( 'cache' => false, // don't let it write to cache 'getFromCache' => false, // don't let it read from cache 'getOne' => true, // return a Page instead of a PageArray )); $changedfields[] = $oldPage->fields->$fieldname->label; } } $changedfields = implode(", ", $changedfields); if(!empty($changedfields)){ $this->warning(__("The following fields have been changed: {$changedfields}")); } } }); Change the configuration block to your needs (template names, field names). This little code snippet outputs only a warning message which fields have been changed - not more or less, but you can also run some other logics - its up to you. Note: Works also with repeaterfields, but you can only check the repeaterfields for changes in general. It is not possible to check for specific fields inside the repeater.1 point
-
Tabs 4 Life, brah! There is no more definitive authority than Richard Hendricks: (I've posted that before but could not resist) But seriously, the PW code style gets things so right. The braces style too. Some reasoned argument: https://github.com/php-fig-rectified/fig-rectified-standards/blob/master/Reasoning-Tabs-vs-Spaces.md https://github.com/php-fig-rectified/fig-rectified-standards/blob/master/Reasoning-Brace-Styles.md1 point