Leaderboard
Popular Content
Showing content with the highest reputation on 10/19/2022 in all areas
-
Github: https://github.com/thetuningspoon/AdminPreSaveValidation This module prevents admin editors from saving changes to a page that has one or more invalid fields. It uses an ajax call to check for errors and javascript to populate the page edit form with any error messages that were returned. This way the user can correct the issues and resubmit the form without invalid data getting saved to the database or the editor losing changes. I've wanted a way to implement this common workflow in ProcessWire for some time now and this relatively simple ajax-based approach makes it possible without getting too much in the way of how ProcessWire normally works. For example, all of the post-save actions (Save + Exit, Save + View, etc.) still work as usual. The only downside is that a successful save will take a bit longer as it involves two sequential http requests (the initial ajax request that checks for errors and the normal page submit after no errors are returned). This module has also been tested successfully with repeaters and other nested inputs. By hooking after Inputfield::processInput, you can add your own custom validations to inputfields and this module will pick up on and display them as well. /* * Example of hook that adds an error to an inputfield. This will add an error to every input. */ $this->wire()->addHookAfter("Inputfield::processInput", function(HookEvent $event) { $event->object->error('Invalid input!'); }); I hope others will find this module useful!10 points
-
Based on this comment: Plus activity and familiarity, I am also thinking summernote ?, or Trumbowyg. Although there is a million other possibilities here.2 points
-
As for direct statement about financial advantages I cannot provide anything (thought I remember reading something related to it) but I do infer such a thing from this comment, for example: https://processwire.com/talk/topic/2043-drupal-vs-processwire/?do=findComment&comment=19084 Quote: "The problems with Drupal have certainly been a motivation in making ProcessWire happen. Out of the box, ProcessWire is going to be a lot better at the large scale than Drupal. ProcessWire's architecture, foundation and API are far better than Drupal (captain obvious)." Well, while writing this, I actually remember reading somewhere that he wrote that his previous way of doing business (when still using Drupal perhaps) was more profitable than the current one based on ProcessWire, but that is not just about working with PW vs Drupal but as business as general. Maybe we should ask @ryan itself? Anyway, as an addition to the actual topic: This might also help @3fingers when explaining the benefits: https://processwire.com/talk/topic/4426-pushing-pw-in-web-design-agencies/2 points
-
A combination of this module and the right selector: $user->hasRole($role) should do the trick ;)1 point
-
Thanks @szabesz, I followed that thread long time ago, there are some very good points I can bring to the table eventually.1 point
-
Hi, juste for those two plugins, you'll find the links here https://ckeditor.com/docs/ckeditor4/latest/examples/codesnippet.html just pay attention when you download a plugin, quite often there are dependencies you'll have to download and install too installing a plugin is often as easy as putting the folder into the pw site/modules/InputfieldCKEditor/plugins folder that pw creates the first time you choose CK editor as your textarea field type afterwards, in you CKE field config you'll see the list of plugins that are in this folder, check the ones you need when a simple functionnality like nbsp for example, nothing else to do, when the plugin allows you to add a button to the toolbar, will be your case, just add its name in the toolbar list of buttons the pw way where you want it to be you'll probably have to test where to use uppercases but honestly, it works like a breeze too ? have a nice day and CKEditor trip ?1 point
-
what @Jan Romero says ? and i would just add, if your code snippets are parts of a larger ckeditor content type, you could just add their code snippet plugin and, if you want it to be stylized the dev fashion way, add the code snippet geshin plugin too ? ckeditor is easy to customize and has a bunch of plugins you can use depending on what you need have a nice day1 point
-
Hi @Guy Incognito, thanks for replying. In the short term it looks like the current client might be moving away from Zoho so we've paused further development for now. However, I know some of our other clients still use Zoho so I may be back in touch at some point if that's ok!1 point
-
What TextFormatter are you using? The Parsedown formatter for example will wrap indented blocks in <pre><code></code></pre> tags. It will also give the code tag a class if you use backtick syntax and specify a language: Will turn into: <p>Some prose text.</p> <pre><code class="language-SQL">select * from pages p left join field_title t on p.id = t.pages_id where p.templates_id = 69</code></pre> <p>More prose.</p> Then you can use the class to apply syntax highlighting.1 point
-
In case someone feels like contributing by replacing Flourish with imap_open, this code should get you started: $inbox = imap_open('{imap.gmail.com:993/imap/ssl/novalidate-cert}', 'address@domain.com', 'password'); $msgnos = imap_search($inbox, 'UNSEEN'); if($msgnos) { foreach($msgnos as $msgno) { imap_setflag_full($inbox, $msgno, "\\Seen \\Flagged", ST_UID); $header = imap_headerinfo($inbox, $msgno); $bodyText = imap_fetchbody($inbox, $msgno, 1.2); if(!strlen($bodyText) > 0) { $bodyText = imap_fetchbody($inbox, $msgno, 1); } $timestamp = strtotime($header->date); $toObj = $header->to[0]; $fromObj = $header->from[0]; $to = $toObj->mailbox.'@'.$toObj->host; $from = $fromObj->mailbox.'@'.$fromObj->host; } }1 point
-
Another HUGE THANK YOU to @gebeer for another PR that improves the downloadModule() method ? https://github.com/baumrock/RockMigrations/commit/9e82e117a43c77cfb94a55c14b822bc627e5649a1 point
-
Relying on the frontend cache all the time is the telltale sign of the system's request process being very slow most of the time. Usually it is the result of over-engineering and "enterprise developers" are soo keen on that. In my coding vocabulary: $enterprise === $overEngineering // > true Also tell them that Ryan developed ProcessWire because working with Drupal took so much extra time that even developing his own system was a lot better choice, therefore more profitable. Probably Nette's Tester can do the trick when they complain, see:1 point
-
1 point
-
@tires the hook need to be Session::loginSuccess - the one given by @adrian - to redirect the user, after he log in. You can write the target url in the session, and you do not really need the GET variable. But as I said in the first idea, if you need to differentiate a user which come from the mailed url, you "have" to give a GET variable or a segment. If you do not do that, the url set in the session will be for all users. It might not be an issue for you. I all needed template, just set $page->url in the session. Apply logic there. And as I said, without distinction, it will apply for all users.1 point
-
Usually I set the font size in the html or body tags, and then use rem for pretty much everything else. I use em in the rare occasions that the size of an element should definitely dependent on the size of the parent, but usually I want the flexibility to control them independently of each other with rem. When you use em on everything, it's very easy to overlook small differences between the text inside elements and you end up having the same kind of text set in 11.5px and 12px in different places, for instance. As for the base size itself, it depends a lot on the layout. Some layouts account for large screens, and divide into multiple columns. On those cases the base font can usually stay the same though any screen size, and can be set in pixels or em. On more static layouts I normally want the font to grow a bit with the screen width, but not too much (I mean, not proportionally. I want it to grow less and less as the screen becomes larger). For that I use a calc() to create a relation between the vw and the pixels. For instance: font-size: calc(8px + .7vw); And I usually want to define a minimum and a maximum sizes. This can be done with media queries, or simply by using the clamp function: font-size: clamp(15px, calc(8px + .7vw), 20px); This defines that the font grows with the screen width but never becomes smaller than 15px or larger than 20px.1 point
-
Wouldn't this be the concept of a template, that has the 15+ fields you need. So on your page tree you could end up with something looking like this: - Cards (a page with a template called cards-display-page, without any other field aside from title) -- Card 1 ( a page with a template called card, with the 10+,15+ fields you need) -- Card 2 (another page of type card, ready to be filled) Since you seem to be new to ProcessWire (at least from what I perceive on your posts!), maybe you are not familiar with the idea that a Page can also be just a sort of "data bucket", it doesn't really have to render the page itself. I see that you have solved this issue of your cards with a Repeater, though just wanted to let you know you could potentially do this, and actually behind the curtains, Repeater items are actually regular Page objects! I have used Perch in the past to build a couple sites and I do remember it was very practical to define fields inside the templates.1 point
-
The Processwire Paradigm has already decided for CKEditor 5 No need to question it.0 points