Jump to content

bernhard

Members
  • Posts

    5,722
  • Joined

  • Last visited

  • Days Won

    271

Everything posted by bernhard

  1. Friends of mine just showed me their firebase setup. They have collections and documents and so on and they have the problem that they don't have a fool-proof way to manage those collections (user data of their app, like customers, partners etc). ProcessWire's admin is such a great way to structure such content quickly and easily, so I wonder if anybody of you has ever built something where ProcessWire and Firebase where talking to each other. I think it shouldn't be too hard to build a PW instance that makes it easy to manage firebase data. Only thing I'm wondering is the communication between the two systems. It's an early stage idea so I'd be happy to get some pointers or experiences. Thx! ?
  2. Building lots of process modules? This snippet might be something for you (hit ctrl+shift+p and type "snippets" and create/edit php.json): And one for creating the execute methods. I'm almost always rendering forms in those methods, no standard html, so this makes me more efficient:
  3. Just tried tailwindcss as base stylesheet for mpdf ? <?php require_once __DIR__ . '/vendor/autoload.php'; $mpdf = new \Mpdf\Mpdf([ 'defaultCssFile' => 'css/prod.css', 'format' => [190, 236], 'orientation' => 'L', 'default_font' => 'arial', ]); $mpdf->WriteHTML('<h1 class="text-center bg-blue-700 text-yellow-200 mx-64 py-2 font-extrabold text-3xl rounded-full">Hello world!</h1>'); $mpdf->WriteHTML('<svg class="stroke-current text-purple-500 inline-block h-12 w-12" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> <circle cx="8" cy="21" r="2"></circle> <circle cx="20" cy="21" r="2"></circle> <path d="M5.67 6H23l-1.68 8.39a2 2 0 0 1-2 1.61H8.75a2 2 0 0 1-2-1.74L5.23 2.74A2 2 0 0 0 3.25 1H1"></path> </svg>'); $mpdf->WriteHTML('<div class="my-10 bg-red-100 border border-8 border-red-400 text-red-700 px-12 py-3 rounded relative" role="alert" style="border: 1px solid red"> <strong class="font-bold">Holy smokes!</strong> <span class="block sm:inline">Something seriously bad happened.</span> <span class="absolute top-0 bottom-0 right-0 px-4 py-3"> <svg class="fill-current h-6 w-6 text-red-500" role="button" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><title>Close</title><path d="M14.348 14.849a1.2 1.2 0 0 1-1.697 0L10 11.819l-2.651 3.029a1.2 1.2 0 1 1-1.697-1.697l2.758-3.15-2.759-3.152a1.2 1.2 0 1 1 1.697-1.697L10 8.183l2.651-3.031a1.2 1.2 0 1 1 1.697 1.697l-2.758 3.152 2.758 3.15a1.2 1.2 0 0 1 0 1.698z"/></svg> </span> </div>'); $mpdf->WriteHTML('<hr class="my-2">'); $mpdf->WriteHTML('<div class="bg-indigo-900 text-center py-4 lg:px-4"> <div class="p-2 bg-indigo-800 items-center text-indigo-100 leading-none lg:rounded-full flex lg:inline-flex" role="alert"> <span class="flex rounded-full bg-indigo-500 uppercase px-2 py-1 text-xs font-bold mr-3">New</span> <span class="font-semibold mr-2 text-left flex-auto">Get the coolest t-shirts from our brand new store</span> <svg class="fill-current opacity-75 h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M12.95 10.707l.707-.707L8 4.343 6.586 5.757 10.828 10l-4.242 4.243L8 15.657l4.95-4.95z"/></svg> </div> </div>'); $mpdf->WriteHTML('<div class="bg-orange-100 border-l-4 border-orange-500 text-orange-700 p-4" role="alert"> <p class="font-bold">Be Warned</p> <p>Something not ideal might be happening.</p> </div>'); $mpdf->WriteHTML('<button class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded-full"> Button </button>'); $mpdf->WriteHTML('<div class="max-w-sm rounded overflow-hidden shadow-lg"> <img class="w-full" src="/img/card-top.jpg" alt="Sunset in the mountains"> <div class="px-6 py-4"> <div class="font-bold text-xl mb-2">The Coldest Sunset</div> <p class="text-gray-700 text-base"> Lorem ipsum dolor sit amet, consectetur adipisicing elit. Voluptatibus quia, nulla! Maiores et perferendis eaque, exercitationem praesentium nihil. </p> </div> <div class="px-6 py-4"> <span class="inline-block bg-gray-200 rounded-full px-3 py-1 text-sm font-semibold text-gray-700 mr-2">#photography</span> <span class="inline-block bg-gray-200 rounded-full px-3 py-1 text-sm font-semibold text-gray-700 mr-2">#travel</span> <span class="inline-block bg-gray-200 rounded-full px-3 py-1 text-sm font-semibold text-gray-700">#winter</span> </div> </div>'); $mpdf->Output(); At least for paddings, margins, text-alignments and colors this could also be helpful. It seems borders do not work - the red border is done manually via "1px solid red" style rule.
  4. Wow, just found their resources page ? Might be worth a look for someone else too: https://tailwindcss.com/resources
  5. I meant bloat in the CSS of all those components that might never get used: --- Yeah, thx for the explanation. That's exactly how I understood everything. I like the concept, just need to see which approach fits better to my workflow or project. Maybe I'll use both in the future. I have to try tailwind and report back ? I have two ideas....... --- Good read, thx! ?
  6. This looks very interesting! Thx for sharing @Sergio and thx for linking to the screencasts @kongondo - they really give a quick introduction and many times it felt as he was reading all the questions that where coming up in my mind. They did an awesome job here. I'm not very experienced in frontend stuff, that's why I like using uikit and all its predefined components. It's quite easy to customize with LESS and you can even use hooks (https://getuikit.com/docs/less). Shouldn't it also work with purgecss (this was also new to me)? So far it seems to me that uikit and tailwind are not that different?! Uikit also has lots of utility classes (like uk-padding-large, uk-margin-small-left, uk-text-bold etc). Only difference seems to be that tailwind is even more unopinionated / low level? So using tailwind you'd get more customized components and less bloat whereas using uikit you'd get all the existing components from start but also get more bloat, is that correct?
  7. @ryan any news on this? It works really great in my setup and I think this approach can open up a lot of great options for a better DEV/LIVE workflow with processwire. In my current project where I modified the core file it was really just doing a git clone myrepo.git git submodule update --init --recursive # restore db dump And I had a working copy of the site that downloaded all assets on demand while working with it! This is really awesome but it would break on every core update. I could implement some hack that does a str_replace and file_put_contents in my dev environment to prevent updates breaking this feature, but it's really just adding three underscores to one core file thanks to the ingenious hook system ? PS: I've created an issue for this: https://github.com/processwire/processwire-issues/issues/954
  8. $wire->addHookAfter("InputfieldForm(name=form-application)::processInput", function($event) { $form = $event->object; /** @var InputfieldForm $form */ if(count($form->getErrors())) return; // do your stuff $input = $event->arguments(0); }); Something like this? See https://processwire.com/api/ref/inputfield-form/process-input/
  9. This module will log information about all mails that are sent via WireMail to the PW logs From PW Weekly: https://github.com/BernhardBaumrock/RockMailLogger https://modules.processwire.com/modules/rock-mail-logger/
  10. Another little helpful update: Added support for colDef callbacks. Before: col = grid.getColDef('id'); col = RockGrid.colDefs.rowActions(col); col = grid.getColDef('created'); col.headerName = 'Datum'; col = RockGrid.colDefs.date(col); After: grid.getColDef('id', function(col) { col = RockGrid.colDefs.rowActions(col); }); grid.getColDef('created', function(col) { col.headerName = 'Datum'; col = RockGrid.colDefs.date(col); }); The benefit is that before if the column did not exist for whatever reason (eg the column is hidden for some users) the JS broke and stopped execution because "col" was undefined and setting options on an undefined column definition doesn't work.
  11. Just added support for Fieldsets. They work a little differently than normal fields, because they need a corresponding _END field. Now if you create fieldsets in your migration those fields will automatically be created and automatically be added to a template: Upgrade: // create tab and add it to invoice template $f = $rm->createField('dunningtab', 'FieldtypeFieldsetTabOpen', [ 'label' => 'Mahnwesen', ]); $rm->addFieldToTemplate($f, 'invoice'); // create sample field and add it to this tab $f = $rm->createField('invoiceinfo', 'FieldtypeRockMarkup2', [ 'label' => 'Info zur Rechnung', ]); // add it after the field "dunningtab", before the field "dunningtab_END" $rm->addFieldToTemplate($f, 'invoice', 'dunningtab'); Downgrade: $rm->deleteField('dunningtab'); $rm->deleteField('invoiceinfo'); This will remove your field from all templates where it is used and also remove the corresponding closing field ?
  12. It's all in the facebook docs: https://developers.facebook.com/docs/plugins/comments/
  13. The newest version of RockGrid now supports RockFinder2 as data source ? $finder = new RockFinder2(); $finder->find('template=basic-page'); $finder->addColumns([ 'title', 'body' ]); $this->setData($finder); Data is available on the JS side via the RockFinder2 property in the GridItem object:
  14. In RockFinder2 I'm hooking into ProcessPageView::pageNotFound: https://github.com/BernhardBaumrock/RockFinder2/blob/master/RockFinder2.module.php#L127
  15. No, but on a second thought I got that my screenshot is not exactly answering your question... A shop module could totally make sense in a separate tab (menu item) even for superusers. I'd have to think more about that. A quick idea would be a redirect module that adds custom menu items for some users that actually live somewhere else? I think AOS has a similar feature.
  16. I think it's great to have all modules under "Setup" for Superusers and for clients on bigger sites/apps you can separate modules into several sections:
  17. Offtopic, but have you (@zeka) had a look at RockFinder and RockGrid? And the upcoming RockFinder2 and RockTabulator? ?
  18. Hm... For whatever reason the halt() method is protected and can therefore only be called from within the class or derived ones. Passing $this to the function does not work and I don't know of any solution other than using die() or exit() in this case. Or just let the function return false and halt outside in that case: function foo() { if(...) return false; echo 'foo bar'; } if(foo() === false) return $this->halt(); echo 'something more';
  19. Hi @tpr any chance we can get a fix for this issue in AOS as long as it is not fixed in the core? https://github.com/processwire/processwire-issues/issues/812#issuecomment-520855872 Thx ?
  20. I've never used url segments in the admin myself. You can always use url parameters though. Only thing you have to keep in mind is that PW strips off all parameters except the ID parameter when a user is not logged in and wants to visit yoursite.com/yourbackend/yourmodule/?id=1&foo=2&bar=3 which would mean he would be redirected to yoursite.com/yourbackend/yourmodule/?id=1
  21. Can we see your executeRefresh() method? Maybe it's just a typo? I'd try "foo" + "executeFoo" instead of "refresh" - maybe it's a reserved word for whatever reason or conflicting somewhere else?
×
×
  • Create New...