Jump to content

bernhard

Members
  • Posts

    6,638
  • Joined

  • Last visited

  • Days Won

    360

Everything posted by bernhard

  1. Hey @FireWire any idea why this is not working: Never used this feature before, so I might be doing something wrong? Thx for your help!
  2. Hello and welcome to ProcessWire πŸ™‚ Seems you are lucky - this is my setup that I just shared 4 days ago:
  3. That's wrong. It should either be $rockfrontend or rockfrontend()
  4. RockFrontend will not be deprecated. I need it for every project. I just moved styles() and scripts() and LiveReload to another module. Regarding asset minification: I need that on almost every module that I create. I have some CSS or LESS files in the module's /src folder and I want to compile them to CSS / minified CSS. I did that using RockFrontend, which is not really what the module was built for. Now this is done with RockDevTools. Same for LiveReload. I need LiveReload for development, both on the frontend and on the backend. All the time. But only on my development machine, not on production. That's how RockDevTools works now.
  5. Just released v5.0.0 of RockFrontend LiveReload has been removed (moved to RockDevTools) styles() and scripts() feature has been removed (moved to RockDevTools) RockDevTools is unfortunately not a drop-in-replacement as we had to change how assets are handled and included into the final website markup. The good news is that RockDevTools also supports merging multiple files to one and it will also work with template cache enabled πŸ™‚
  6. Imagine you have a multisite setup where you need different languages for different domains: One website might be single-language (DE only), another one might need DE/EN/CZ, and another one might need DE/EN/HU: I didn't know how to do it, and I didn't find any other posts with a similar need or solution. When looking into the code I even thought that my need was not possible yet without modifying a core file. So I asked Ryan if he was willing to make the process of adding languages to the $languages array hookable. Turns out that this is not necessary! All you have to do is to grab the Iterator of the languages array and remove languages as you need: // /site/ready.php if($anyCondition) { // remove CZ language $languages->getIterator()->remove("name=cz"); } So simple 😍 Maybe it helps πŸ™‚
      • 4
      • Like
      • Thanks
  7. Hi everyone! I've started working on a new module that contains development tools like asset minification. Why a new module when RockFrontend and RockMigrations already have similar features? I wanted to start fresh to make the code cleaner, and most importantly make it work properly with template cache! The old implementation in RockFrontend using page render hooks simply couldn't handle that. The module is intended for development-only and should be disabled on production. The idea is to create minified assets while developing and then push the minified assets to production and there just include them in your markup! LiveReload has also been moved from RockFrontend to this module. It's simply not a frontend-tool but rather a development tool! Using RockMigrations, for example, I'm always using the LiveReload feature on the backend, so it does not really make sense to have it in the frontend module πŸ™‚ Download & Docs: baumrock.com/RockDevTools
  8. Anybody stumbling over this site profile might also be interested in my new RockInvoiceItems Fieldtype/Inputfield πŸ™‚
  9. Rock-Monthly Newsletter subscribers know that I'm rebuilding my custom CRM/bookkeeping software. It has already sparked two powerful new Rock modules! πŸš€ RockInvoiceItems provides a powerful Fieldtype/Inputfield combo for handling invoice line items with real-time calculations, rich text editing, and a clean UI. Key Features: Dynamic line item management (add/delete/clone/sort) Rich text editing item descriptions with TinyMCE Automatic calculations (subtotals, VAT, grand totals) Multiple VAT rates support Drag & drop sorting Easy to use PHP API, eg $items->subtotal(), $items->grandtotal() German translations included The module extends WireArray and handles all the JSON serialization/deserialization behind the scenes. It's easy to install - just drop it in your modules folder and you're ready to go! Download & Docs: baumrock.com/RockInvoiceItems Let me know if you have any questions! πŸ‘‹
      • 5
      • Like
  10. Rock-Monthly Newsletter subscribers know that I'm rebuilding my custom CRM/bookkeeping software. It has already sparked two powerful new Rock modules! πŸš€ This module allows you to quickly connect a datefrom and a dateto field and calculate a duration, plus it adds buttons to quickly set the date/time of both fields in customisable increments: Download & Docs: baumrock.com/RockQuickDates Let me know if you have any questions! πŸ‘‹
      • 5
      • Like
  11. That's a valid question by the client. That's why I do not allow images in richtext fields. But there's never an "ideal approach". Everything has pro's and con's.
  12. RepeaterMatrix and RockPageBuilder. There you don't add content to one WYSIWYG field but instead compose your blog content from predefined blocks where you have full control over the generated markup for each block and the client still has the flexibility to choose whatever blocks he/she needs. Similar to what @Robin S suggests if you are using RockFrontend that's already on board via Dom Tools. $dom = rockfrontend()->dom($page->your_wysiwyg_field); $dom ->filter("img") ->each(function (HtmlPageCrawler $node) { $newHTML = '...' $node->replaceWith($newHTML); }); echo $dom->html(); I'd highly recommend not to use images in richtext fields, though.
  13. It should not matter when/where you do it. The only thing that matters is that you attach your hook before you actually call the method that is hooked. If you call the method first and than add the hook it will obviously not return the hooked result but the plain result.
  14. I'd be interested, but I don't understand what you are saying. Neither what you said yesterday nor what you said today. What is "a class loaded directly on a page"? And what is "indirectly within a form" ?!
  15. Thx, will be added in the next version!
  16. /site/init.php wire()->addHookAfter('Foo::hello', function ($event) { $event->return .= ' - hooked :)'; }); /site/modules/WhatEver/Test.module.php <?php namespace ProcessWire; use MyNamespace\Foo; class Test extends WireData implements Module { public static function getModuleInfo() { return [ 'title' => 'Test', 'version' => '0.0.1', 'summary' => 'Your module description', 'autoload' => true, 'singular' => true, 'icon' => 'smile-o', 'requires' => [], 'installs' => [], ]; } public function init() { wire()->classLoader->addNamespace('MyNamespace', __DIR__ . '/classes'); } public function ready() { $foo = new Foo(); bd($foo->hello()); } } /site/modules/WhatEver/classes/Foo.php <?php namespace MyNamespace; use ProcessWire\Wire; class Foo extends Wire { public function ___hello() { return "HELLO!"; } }
  17. I'm using namespaces all the time and it works for me when not adding the namespace on the hook.
  18. That's how FullCalendar renders Events and shows their info. It should be configurable though: https://fullcalendar.io/docs/displayEventTime which should be easy to hook: https://www.baumrock.com/en/processwire/modules/rockcalendar/docs/hooks/#getitemarray
  19. Hi @Pavel Radvan these kind of errors are easy to solve by searching the error message in google: https://www.google.com/search?q=class+domdocument+not+found&oq=class+domdocu&gs_lcrp=EgZjaHJvbWUqBwgAEAAYgAQyBwgAEAAYgAQyBggBEEUYOTIICAIQABgWGB4yCAgDEAAYFhgeMggIBBAAGBYYHjIICAUQABgWGB4yCAgGEAAYFhgeMgYIBxBFGDzSAQgzMDg4ajBqN6gCALACAA&sourceid=chrome&ie=UTF-8
  20. Hey @herr rilke please use the new RockDevTools module for handling assets: https://github.com/baumrock/RockDevTools/tree/dev/docs/assets Due to several limitations and issues like you have found asset tools of RockFrontend will be removed in the next major version. Please mark this [solved] if everything works for you.
  21. Could you share the exact code? As far as I understand your screenshots ProcessWire tries to call ->getShowByArtist() but doesn't find it and therefore tries to run Hooks, which is what it does to execute any methods that are attached via hooks and not really added to the class itself. The question is still why it doesn't find the getShowByArtist method when it should be there. In your case I'd search my codebase for "getShowByArtist" and make sure that it only exists at one single location. Then, I'd remove that call and replace it with a bd() call, for example bd($item). Tracy should then dump a "HomePage" object to the debug bar. If it dumps a different object, then it makes sense that it throws an exception that the getShowByArtist method does not exist.
  22. On the template settings of every template you can define whether this template defines access settings or not. If not, it inherits from the parent template. As page id=1 does not have a parent template it is required that the template set for page #1 has access settings enabled.
  23. Agreed. When using Custom Page Classes + MagicPages these kind of things are super easy to do: <?php public function onCreate() { $this->mycheckbox = 1; } But a hook in /site/ready.php would also not be much more work. Just less beautiful in my opinion πŸ™‚ <?php wire()->addHookAfter('Pages::saveReady', function($event) { $p = $event->arguments(0); if($p->id) return; if($p->template != 'whatever') return; $p->mycheckbox = 1; });
  24. Sorry, I don't understand your example. Please show screenshots and explain what you'd expect and what you actually see.
Γ—
Γ—
  • Create New...