Jump to content

kongondo

PW-Moderators
  • Posts

    7,529
  • Joined

  • Last visited

  • Days Won

    160

Everything posted by kongondo

  1. Do you have Tracy installed? If yes, could you add the following before line 302 in MarkupMenuBuilder.module (e.g. on line 297) and tell me what Tracy reports? d($menu); // or this one bd($menu);
  2. Good point. Don't remind me please ...? I'm still very raw ?.
  3. The challenge here is that what if admin opens the page for editing but saves it without filling any of the required fields? Doesn't the page still save in that situation? (I can't remember). If it does save, then the condition will fail since the page has been saved but the required fields are empty, and hence, a new page will be created. One alternative (just thinking on my feet here), would be to assign the newly created pages a 'temporary-template'. When editing the page, on save we change its template (e.g. 'some-template'). Then in your hook, check if template == temporary-template return.
  4. It shouldn't matter and I don't mean to be pedantic here ? but page creation (actually anything CRUD in ProcessWire) whether via GUI or otherwise, is carried out by the API, the very same API. That's what this will tell you ?: $pages->addHookAfter("added", function(HookEvent $event) { // code here }); It's only called when a new page is created. It will be called whether the page is created directly using the API (ProcessWire, template-file, etc) or via the GUI. It depends on your use case though, so I maybe off here and you could just do a different condition check.
  5. I use multi-sites (ProcessWire inbuilt one, aka Option #1), locally and remotely without issues. Locally, I have two main multi-sites; one for ProcessWire 2.7 and the other for ProcessWire 3.x. It means I don't have to mess about with Apache virtual environments for the 'sub-sites'. For local dev, I just need to make sure that my domains are resolved in hosts file. For module development, I have each module as its own sub-site and the domain tells me what ProcessWire (main) version I'm testing on. So, something like: // processwire 2.7 array( 'mediamanager.pw27' => 'site-mediamanager', 'blog.pw27' => 'site-blog', 'runtimemarkup.pw27' => 'site-runtimemarkup', '*' => 'site' // main/mother site, e.g. sandpit.pw27 ); // processwire 3 array( 'mediamanager.pw3' => 'site-mediamanager', 'blog.pw3' => 'site-blog', 'runtimemarkup.pw3' => 'site-runtimemarkup', '*' => 'site' // main/mother site, e.g. sandpit.pw3 ); This shouldn't be an issue if using Option #1 as each site has it's own 'site' folder, e.g. 'site-a', 'site-b', etc. with their own assets and modules. The issue would of course be, if one of the modules is not compatible with the one 'wire' running the site. It means you might have to do away with that module or not upgrade 'wire' ?. I'd just create my own domains using hosts for lookup and have them served locally.
  6. Or maybe something like this by @Pete? You can modify it to check the user's ID or role and log them out when their session comes to an end? I am not sure if ProcessWire currently stores the time a session started? If it does, you can maybe use that instead of PHP $_SESSION
  7. Maybe I'm missing the point since I don't see the code where you create the page. However, both actions 1 and 2 fire a page->save() event. So, if your code doesn't check whether the page is a new page vs an existing page being edited, a new page will be created. Maybe you can post that part of the code, the one where you create a new page? You might need to hook into two places: When page is created (newly created page): $pages->addHookAfter("added", function(HookEvent $event) { // code here }); And when page is edited: $pages->addHookBefore("saveReady", function(HookEvent $event) { // code here });
  8. What's your environment (PHP ,etc) I've not see this error before. Is this a multilingual site? Other than the warning, does the menu render at all? TracyDebugger error?
  9. Hi all, Feel like I've been to hell and back :-)! No LAMP environment I set up worked! There was always something going wrong; not being able to connect to host, some PHP file extension missing, some cryptic errors!!! I tried Docker so many times I lost count. I even tried XAMPP and quite a number of other variants! Laradock almost worked but then failed on 'cannot connect to host'. In addition, it took a long time to set up. I don't know how many times I went back and forth with docker! I tried using it directly, I tried using docker clients, nothing worked! I almost installed WINE just to ran laragon! I then stumbled upon this Python (command line) docker app called Stakkr. It works! I'm using it in combination with Portainer and Traefik (both running in Stakkr as services). The Stakkr PHP images include all the extensions I need and then some. Yes, even Imagick! This was a pain to set up when I tried other docker PHP images. I needed a database tool to replace Heidi SQL now that I'm not on windows but still need to connect to remote hosts. I found this wonderful tool, DBeaver. I'm using it both locally (so I ditched phpMyAdmin andAdminer) and for remote connections. On the one hand I feel like I've wasted 2 weeks of dev work! On the other, I learnt quite a lot about docker and some related technologies. I have no more hair left to pull out and I haven't been 'nice' to be around not to mention the writer's block I picked up along the way... Back to work I go. Hopefully, no more technological interruptions...at least for some time ?. @fbg13, Thanks for Solus Plasma! I'd gone with Budgie but then tried plasma and wow! It's what I'm using now. It just works, even the printing. I was able to connect without using CUPS in the browser.
  10. That would only happen if the MIME type of the video is some other format not recognised by the system. Are you able to check the MIME type and let me know? If not, I can send you some code to help.
  11. Yes. This has been fixed in the upcoming version. The bug had to do with satisfying some ProcessLister requirement. Behind the scenes each image is a page in ProcessWire. That's why you see this. The ID is the id of the page with the media. Currently no, but sounds like an idea/feature request to consider. Maybe a checkbox or a pattern to detect if images should be kept together e.g. house-1.jpg, house-2.jpg, etc. The upcoming version of Media Manager allows to add images to an existing media page. What sort of changes are these? Changing the images? Cropping? Other? No. I'll see if I can add this. Yes, it does. it respects your media manager settings. The settings apply across board. Sorry for the erroneous info.
  12. Hi @Youbility, First, please accept my apologies for not getting back to you earlier. I've had some serious computer issues that have set me back a couple of weeks. I hope to be back to 'normal' by the end of this week. Many thanks for your purchase. I think you saw the screenshots for the upcoming beta version. Its release has now also been delayed (some unforseen bugs, etc). The current version is not compatible with UIKit. The beta version is not production ready too. This is totally understandable. How would you like to proceed? The beta version may not be out soon. If using an older admin theme, e.g. Reno, is out of the question, then the only option left is not to use Media Manager until the new version is out. I'm happy to offer a refund if you'd rather not wait for the new version. Please do let me know. Thanks.
  13. @aolba, welcome to the forums. How are you rendering your menus? If you are using render() then the classes are already included in <li> or <a> depending on the $options your send to render(). If you are using getMenuItems() with the array option, i.e. second parameter $type = 1, you get your classes in the index css_itemclass. If using getMenuItems() to return an object, you get the classes at $m->cssClass where $m is a single menu object/item.
  14. Hi @Nekorin, Welcome to ProcessWire and the forum ? Many thanks for the purchase. Thanks for reporting this. I'll have a look. I couldn't see this happening in your illustration video though; must have missed it :-). I'm not sure I follow completely. You are able to FTP files into the directory /sites/assets/MediaManager/uploads/. You can then use the scan feature in the uploads dashboard to move the files to the Media Manager library. The main purpose of Media Manager is to create one large, central bucket for all your media. Content editors should then be able to pick any of the images in Media Manager to use in any page. Please let me know if I misunderstood your request.
  15. Good points, thanks. I'm questioning whether I need to use Docker at all. I'm not sure I see its benefits (I've read lots of docs) in my case. I just need a server for PHP development (mainly modules). I'll have a look at laradock.
  16. Thanks @fbg13 and @Beluga, I've also had a look at Portainer, DockStation and Kitematic. I've installed DockStation and it seems to work fine, but it is a bit slow in reading from Docker Hub (it doesn't seem to cache results) and it looks like a mac app :-). I'll probably end up just running server components directly.
  17. Hi all, Me again! I've installed most of the things I need. I'm still very impressed that unlike previous instances, everything (well, most everything), just worked. I didn't need to search for drivers by myself. My machine was always fast on Win7 but it is blazing fast now! I've hit a snag and would like some advice. Rather than install a server myself (Apache, MySQL and PHP), I decided to try Docker. I found a LAMP image and it installed fine. I then tried to locate the path to PHP and couldn't find it! It turns out 'one can't find it in Docker?'. I can see it in PHP info, but there's not PHP in that folder! Anyway, I need this for Visual Studio Code; for linting, debugging etc. As it is, I haven't been able to code for 2.5 days now! I almost threatened the computer that I would install XAMPP on it instead (!) just to get going, but then thought better of it ?. Before I go down the 'normal server' route where I install these server components individually (I can do it but just wanted to avoid spending more time on this), any advice? Thanks.
  18. Thanks Thanks!
  19. Genius! It worked! Thanks! Cups was already installed. Do you know if I can setup wireless access to the printer using Cups? I haven't seen anything to that effect. It's not a big deal though. I just need to get the scanner working and I'm set!
  20. Thanks all! I went with Solus. I'm now trying to install my printer but failing. Not sure where to start! I've downloaded some 'printer scanner' packages from Canon and that's it. I don't know what to do with them, hehe. Plus, some are debian based and others are RPM. I can't find info on what is suitable for Solus :-). @fbg13 (or anyone else), any tips on what next/must dos after installing Linux? Thanks!
  21. It's gonna feel odd not running LAMP using Laragon or XAMPP ?
  22. Thanks. I was about to ask about that. I've seen Cinnamon, Xfce and Mate and I can't tell them apart ?.
  23. I had a Brother printer which served me well for a while then just went kaput! So, I got a cheap Canon as I don't print much (I mainly use the scanner). It's a Canon PIXMA MG3650
  24. Thanks. I'll have a look.
  25. Thanks @Beluga Been there! We'll I hope one of them works with my Canon!
×
×
  • Create New...