Jump to content

bernhard

Members
  • Posts

    6,674
  • Joined

  • Last visited

  • Days Won

    367

Everything posted by bernhard

  1. Hey @Richard Jedlička thx again for your great module! I'd have a request: Would it be possible to add a second icon to the template edit button on the page editor so that when clicked it opens the corresponding file in the IDE? The link could easily be taken from tracy settings and the filename is easy to get via ReflectionClass: $r = new \ReflectionClass($page); db($r->getFileName()); Similar to the field edit links there could be a second icon on hover that, when clicked, takes you directly to the PHP file of the custom page class that is responsible for the currently viewed page's template ? What do you think?
  2. Hey @fruid have just been working on logs on another module. This is how you can prune the logs to a given number of bytes: $this->wire->log ->getFilelog("rock-mail-logger") ->pruneBytes(2000); This will prune the log to 2000 bytes (which is obviously very little just for testing).
  3. Thx @fruid for the clarification. First of all how many emails did you send to get a 10GB logfile?? The logger logs quite a lot (headers etc) but I thought better to have than to miss it. I think the easiest way to do the cleanup would be to do the cleanup whenever a new log entry is created. That should be really easy to do using https://processwire.com/api/ref/wire-log/prune/ So you could add a config setting to the module that holds the maximum number of days the log should be kept and everything should work fine. This might also be a good idea regarding gdpr or similar regulations. That only depends on your server setup. You could also create PHP scripts that have root access to your server. It only depends on the permissions you give to PHP (for example to use exec()) and to the user that runs the script.
  4. I read your message as "thank you for your help". You are welcome. A better practice than sending massive amounts of spam emails and logging all of them without cleaning up the logs from time to time? Sending only necessary mails. And cleaning up the logs ?? Or a better practice than complaining about free and open source modules? Helping to debug things and then trying to add improvements and creating a PR ? You could for example add the option to cleanup the mail log automatically after x days or after y logged mails...
  5. Just find the correct logfile in /site/assets/logs, rename rock-mail-logger.txt to rock-mail-logger-bak.txt and then create an empty rock-mail-logger.txt and see if that changes anyting in behaviour.
  6. Hi @fruid I don't think that my module causes this as I'm simply using PW's logging features. You can try renaming the log to something different and using it with a subset of the real data. Then copy over junk for junk and see if/when the error starts to occur. Not sure if that's the right thing to do with 504 errors but that could bring more insights.
  7. Loving it ? You can't do that ? What is it? https://github.com/quilljs/quill ? https://github.com/summernote/summernote/ ? Also, some insights on that part would be especially interesting ? Fingers crossed for a smooth transition! Thx for all your great work!!
  8. Yeah I agree it's quite a hidden feature. Similar to the double-click-delete on files/images... I think there has been some discussion about it some time. Maybe it was a github request, don't know ? But a note would certainly not hurt here ?
  9. Thx for the screencast ? Can't you do a SHIFT+CLICK to select all from the first click until the last click?
  10. v2.1.0 adds a totally revamped module config and changes the way some assets are loaded - if you used some RockFrontend magic and notice something is not working any more after upgrade make sure that all necessary features are enabled and all necessary assets are loaded: If you find anything that should be added to those settings let me know! @dotnetic ?
  11. As you might have noticed I try to improve my frontend skills ? And now that I have RockFrontend I can invest on all those little details that are tedious to implement but always the same. One of those things that has always annoyed me is switching the main navbar to the mobile menu toggle and vice versa. How do you do that? I've always done that using breakpoints (simply using uk-hidden@m / uk-visible@m) or using custom breakpoints. The problem here is that the main menu might change due to user input. Or it might change in width due to changing the language. The PW backend uses a JavaScript solution that shows the menu as long as there is enough space and shows the burger if not. Is that a good solution for a real website? Any tips on how to best implement that? Would be using the ResizeObserver be sufficient? Thx for your input ?
  12. Robin's module is more flexible but needs more setup. That's why I created my plug&play module. And the UI is a little different.
  13. No readme yet but could do exactly what you need: Upload images in one central place and then pick one of them on the related page: https://github.com/baumrock/RockImagePicker If you have any questions or find issues let me know. If you find time to write some instructions / screenshots for the readme that would be great ?
  14. Thx @nbcommunication for the module. It looks great. It's my first time using responsive image sizes (shame on me) and I have a question: I'm using this ruleset: On a 500px screen with 1x pixel ratio this loads the 640 image. Great. But on a 2x pixel ratio screen it always loads the 2048 image. Not so great ? Can I somehow tell my browser to load a 1280 (2*640) image on 500 pixel screen?
  15. Thx adrian totally forgot about that setting since it's always enabled for me ? Seems to work now and was an easy fix: https://github.com/baumrock/RockFrontend/commit/eafe6b9bf46150101723c5dfa874ce0412dee47e
  16. Thx, it has already been running all the time ? Just tried without it and same issue. What about adding a $config->noTracy = true config setting that makes sure that tracy is not loaded if the flag is true? I could maybe set that on runtime and it could also be nice to have on production servers maybe?
  17. Hey @adrian I get the following error when using Tracy with RockFrontend's live reload feature: Failed to init module: TracyDebugger - Tracy\DeferredContent::sendAssets() called after some output has been sent. Output started at /var/www/html/site/modules/RockFrontend/LiveReload.php:147. This is the line in question: https://github.com/baumrock/RockFrontend/blob/5f6c822f2f561f7b0d90d46e05eb66d2964d7dbd/LiveReload.php#L147 This is how I'm loading the livereload class: https://github.com/baumrock/RockFrontend/blob/5f6c822f2f561f7b0d90d46e05eb66d2964d7dbd/RockFrontend.module.php#L122-L131 It needs to be loaded before session start. I guess Tracy does not like that ? Any ideas how to fix this? Can I somehow tell Tracy not to load for that requests?
  18. Ok then it's not about loading order, then I guess that UIKit.modal() does only work if the modal has some content. If your modal html element does not have content then UIkit.modal(el).show() throws an error, so you either need to make sure that you have some content in your modal or that you show it only if the modal is created properly: <?php if ($page->id == 1): ?> <script> let infoShown = localStorage.getItem('infoPopup'); if(!infoShown) { let modal = UIkit.modal('#modal-center'); if(modal) { modal.show(); localStorage.setItem('infoPopup', 1); } } </script> <?php endif; ?> Maybe you need to change the IF condition to if(typeof modal != 'undefined')... btw I copied your code and you had a space before the .show(): That might also cause problems...
  19. This would be the cleanest imho: $photo = $item->get("image_" . $categorie); You could also do this: $property = "image_" . $categorie; $photo = $item->$property; Or this $photo = $item->{"image_" . $categorie}
  20. I don't understand what you are trying to do. Could you explain that a little more please? I understand parts of what you said but not everything and details are important ? Maybe you can provide a real example of what you have and what the expected output would be.
  21. Update 2022 Custom backend design is very easy now! See https://github.com/baumrock/AdminStyleHello (waiting for a PR to be merged) Continuous Integration is very easy now using https://github.com/baumrock/RockMigrations Data Listing is possible using RockGrid (commercial module, PM me if interested)
  22. The reason for this error is that your code having "UIkit.modal..." is executed too early (before UIkit is available). You need to make sure that you load UIkit before adding the script that shows the modal.
  23. Well, that's a totally different story then. Your explanation was a little short, so I did not realise we are talking about a field of an image rather than a field of a page... I've at least posted an update that forces the first alfred argument to be a Page. And if you provide something else you'll at least get a better error message: I don't know of any good way to render the editor interface just for one single image (or even a field of that image) so I don't think what you are trying to do is easy to achieve.
  24. Thx @MarkE I've modified the behaviour of isActive() so that it treats the homepage different than all other pages. It does now only mark the homepage active if the currently views page is the homepage (id=1). I have not hat that case until now but I think that makes sense 99,9% (maybe 100%) of the time since the homepage would otherwise always be "active" (as any page is a child of the root page), which is likely not what we want. Thx for the input ? Sorry I still don't get it I think. My menus always reflect the page tree. If I want the "home" menu item on the same level as child1, 2 and 3 I simply output it above: <ul> <li><a href=/ n:class="$page->is('/') ? 'uk-active'">HOME</a></li> <li n:foreach="$home->children() as $item"> <a href="{$item->url}" n:class="$rockfrontend->isActive($item) ? 'uk-active'"> {$item->title} </a> </li> </ul> Is that what you are talking about? Not always. If no sort order is specified, they will be in id order (I think) - which is fine if you created them in the order you want. If you specify "sort=sort" then the top level will be correct, but lower levels will get mixed in - see I think you are making things more complicated than they need to be. $page->children() already return the children in the admin sort order. So if you call $page->children() recursively in your menu than the menu perfectly reflects the page tree. https://processwire.com/docs/selectors/ So the problem might be that you are using $pages->find() or maybe that you apply a selector to page->children() ?! For me $page->children() did a perfect job without any extra magic ?
  25. Could you please explain that in detail? This is one of the things that a really believe should not be built custom for every project. They should be done in a place where we can share logic across project and simply call the function that should work everywhere. What I also do not understand: What do you mean by reflect the page tree hierarchy? And what are the custom page class methods for? Doesn't my menu version do the same just without those helper functions? If I call $page->children() then they are already sorted in the correct order, no?
×
×
  • Create New...