Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by teppo

  1. You're correct that AdminBar only applies to users who are logged in. There's no "guest user" when it comes to AdminBar – only superusers and users with the "adminbar" permission will see anything out of the ordinary. Regardless, since AdminBar outputs features visible on the front-end, it's very much connected with everything else happening there. What you're missing here is that being logged in won't disable those browser extensions or nullify the effects of third party libraries – so it's not true that those features would only apply to users who aren't logged in. As such, it's very important that admin bar is as "tolerant" as possible, so that it won't break or cause new problems if you decide to implement a new JavaScript library on your site (or enable a browser feature/plugin).
  2. You're right that browse isn't really a link – that's definitely one that shouldn't be represented by <a> tag 👍 Logout is a border case: technically it can be a link, just like it is right now, but you're right that it probably shouldn't be. On the other hand even changing it to a form isn't, in my opinion, quite enough – it should also provide and validate some sort of nonce/token, just to be sure that it can't be abused. There's no redirect after logout at the moment either, so that's not a major problem. Anyway, I'll figure something out for the next minor release of the module. Create is one of the cases where a link usually makes sense: it should be a link to the "new page" view in Admin in case the modal mode is disabled or JavaScript is for whatever reason out of equation. That being said, I've almost never used the "name format" option, so I didn't even think of that – that behaviour is indeed problematic and needs to be addressed somehow 🙂 It just occurred to me that my earlier explanation was flawed 😞 If you reload, say, just the <main> element within your <body>, and Admin Bar remains as-is, the links/buttons there will point to the wrong page. As such using such plugins you probably would need to reload Admin Bar as well. I could add support for modifying target/parent IDs with JavaScript, but that would still require extra steps for the developer anyway. Also thought about using URL in this case, but that wouldn't help, as Admin Bar can't know for sure if you're using "real" URLs or some custom format (via URL segments, History API, or something else.) Currently I'm thinking that an option for reloading / re-rendering Admin Bar via JavaScript might actually be the best option here: in most situations the module would work right out-of-the-box, but if you do use some sort of front-end routing / transition code, you could somehow tell it to update. Not a perfect solution, so any suggestions are welcome. -- By the way, if – and only if – it turns out that one/some links can't be easily switched to buttons without sacrificing something else, do you know if role="button" would help at all? I wouldn't use that unless I really have to (reinventing <button> with ARIA attributes is almost always just plain dumb), but this might be one of those cases where it's actually the most sensible approach – it would be an improvement in terms of accessibility, but I've no idea if it would help with preload/prefetch/etc. features 🙂
  3. Hey folks – a quick update: Wireframe 0.5.0 was released couple of days ago. Compared to 0.4.x this version mainly fixes bugs and improves performance – nothing particularly major, but if you're using Wireframe, it's a recommended update. On a loosely related note, Tracy Debugger has been really helpful in figuring things out, identifying bottlenecks, etc. Brilliant module 🙂
  4. Hey @chrizz. I'm moving this thread to the "Module/Plugin Development" area of the forum. Please post all module development related questions there – the main "Modules" area is only intended for support threads of existing modules. Thanks!
  5. Hey @kaz. Just a heads-up: I'm moving this thread to the "Getting Started" area of the forum. The "Modules" section is only intended for support threads of existing modules.
  6. Hey @opalepatrick – just a heads-up that I'm moving this thread to the Module/Plugin Development area. The main "Modules" area is only intended for support threads of existing modules.
  7. Thanks for the feedback! Replacing <a> tags with buttons was originally on my list, but I've been pushing it back as there are some additional considerations here: There are some "proper links" (such as the admin link) that should remain that way. As such, this wouldn't apply to all links automatically. When the modal ("slide overlay" in module settings) mode is disabled, almost every item should be a regular link – except for browse, which technically shouldn't do anything there, as in that case it's just an indicator of your "current state". Admin Bar should work regardless of JavaScript. This makes it more robust, and as such more accessible. That last point isn't an argument against using buttons, just something to keep in mind when making changes: everything should remain functional regardless, which could mean links by default (when JS isn't available, or working as expected) and buttons otherwise. Since default styling is now based on BEM, it should make this easier in some respects, though; technically what element is used shouldn't matter anyway. I don't actually see (m)any notable issues in the current behaviour. None of the built-in Admin Bar features will create any content without user actually submitting a form – and I'd be very surprised if a plugin did that on itself. The logout link is problematic though, you're absolutely right on that one – I've added this on my todo list, but not entirely sure yet how to handle it. I'm not familiar with Turbolinks, but the way Barba.js usually works is that you define a container, which you then switch with new content. I'm not particularly experienced in this regard, but to my best understanding you wouldn't usually define your entire <body> element as a container, and since AdminBar attempts to place itself as the last element right before </body> closing tag, normally this shouldn't be an issue – though again, this is just based on my (quite likely lacking) understanding of such libraries 🙂
  8. Thanks – this should now be fixed in the latest version (2.2.2).
  9. This is how Pageimage handles errors that occur while trying to create variations. You can view the relevant parts of the code here. I'm not entirely sure if the error is visible while logged in as superuser, but one option would be enabling debug mode via $config->debug in /site/config.php – this way it should be saved into the image-sizer log file in /site/assets/logs/. Note that you don't want to enable debug mode if this is a live site, though. Optionally if you know when the error is going to occur, you can manually output the $img->error property after the size() call 🙂 There are a few reasons why this can happen, so the first thing would definitely be checking that error message.
  10. Hey stanoliver! First of all, it's difficult to say exactly how to set this up without knowing how your site has been set up etc. but if you're looking for a simple solution, you might want to take a look at the search template in the "classic" site profile: https://github.com/processwire/processwire/blob/master/site-classic/templates/search.php. This is a very bare-bones approach, though, and as such it doesn't handle things like those highlights – but it might be a sensible starting point for your own custom feature. Just modify the fields to search from etc. I know you said that you'd like to achieve this without a module, but I do still think that SearchEngine would make sense here. It does quite a bit for you out of the box. Hope this helps a bit.
  11. Could you clarify this a bit, what kind of mistake are you seeing? So far I haven't noticed anything wrong here, so it might be browser-dependent, or perhaps even site-dependent (Admin Bar is affected by site styles as well, so there's always a chance for that). Please let me know what browser you're using, how it behaves – and if possible, a screenshot would be really helpful too 👍 You mean when you add items via config settings? The order there doesn't actually affect the order of items in the Admin Bar – at least yet. That's something I have on my todo list, but not sure yet when I'll get to it 🙂
  12. Hey folks! Just wondering what everyone is using these days for taking notes on Mac 🙂 I'm setting up a new laptop, and this need came up – once again. On my previous (work) laptop I used TextWrangler and stored notes as markdown files to a directory called "notes" as "YYYY-MM-DD_note-name-here.md", and on the one before that I used Evernote (not sure why but somehow that didn't feel particularly comfy). I've also tried OneNote, but overall it felt quite confusing, and perhaps a bit too "power user oriented". As long as I can take notes easily, store them in some sensible way (preferably ordered by date and perhaps tagged or something), and perform searches on them I'd be perfectly happy. For a while I thought I'd found the perfect solution in an app called "Bear", but turns out it's commercial, and I'd really prefer something free... though it's still on my list, in case I don't find anything better 🙂 Any suggestions – what do you use, and why?
  13. Thanks – this is now included with the latest release, 2.2.1 🙂 I made a couple of minor adjustments: in mobile size the dropdown was positioned slightly too far down so there was a gap between the icon in the bar and the dropdown, and the "ul li > a, ul li > strong" CSS rule was changed to ".adminbar__link" in order to avoid unintentionally affecting unrelated lists on the site. I'll have to think about this a bit, not sure yet how it would fit the module. Technically this could be a relatively simple modification: the dropdown feature used for the "user" item applies to any item that has a "children" array, so one option would be adding that for the edit link. Haven't tested this yet, so not entirely sure, but that's one option at least 🙂
  14. Just checking that I got this right: do you mean that while the "slide overlay" is enabled and Admin Bar links (such as edit, new, and profile) will normally open the edit view in a "modal" window, there would be some way to open the target URL without the modal instead – going to the "full" admin interface? 🙂 If so, I can see value in this idea, but I'm not yet sure how to make that happen without messing up the simplicity of the UI or causing potentially confusing side-effects. Take long-click for an example: in my experience it's actually quite common for users to long-click or double-click things by accident (or by habit), so in my opinion (in a web based GUI) it's usually bad UX for these to lead to a different outcome vs. "regular click". Anyway, I'd be interested in implementing this if there's a way to do it in a sensible way. And please let me know if I've misunderstood your idea 🙂
  15. Hey folks! Just released AdminBar 2.2.0. Here's what's new: New module config settings for selecting items displayed in the Admin Bar. New items, disabled/hidden by default: "profile" (simple profile edit link) and "user" (basically the same concept as the profile edit dropdown menu in Admin). If "user" is displayed, there's a config setting for items displayed under it as well. New hookable method ___getData(). The returned array is converted to an object and stored as JSON (data-adminbar) on the Admin Bar element. This was mainly added for future JS features, but can be used by themes etc. as well. Hookable methods and their primary purposes are now also documented in the README.md file. Quite a bit of code was rewritten – again. I've been splitting some methods to smaller ones to improve maintainability, fixing small issues, improving accessibility to some degree (still needs a lot of work though), etc. Hopefully didn't cause too many new problems in the process... 🙂 Here's a screenshot with new items enabled, though one probably wouldn't want to enable profile and user (and all the user dropdown items) at the same time – and yes, my user name on this site is "admin", so it looks a bit silly when there's an "admin" link before and below it as well 😞 --- Thanks! This will be the next item on my list 🙂
  16. Thanks for the reply, @adrian. Your logic makes perfect sense to me! I didn't think this through: I'm not used to debugging anything on production, so it didn't even occur to me that this way one can actually use Tracy on a real production / live site. I'll have to agree that enabling debug mode on production is a bad idea – partly because something may indeed slip through to the front end, and partly because some modules etc. may in fact behave differently (such as output some sort of debug log on screen) when the debug mode is enabled 🙂 I can definitely live with this, it's really not an issue. Mainly it was just a bit confusing while getting started with the module. Awesome – definitely will check those out! I've only been using Tracy "seriously" as of this morning, but I must say that I'm quite enjoying it already. It's a massive tool and so far I've only used a tiny fraction of its features, but I can see a lot of value in it 🙂
  17. Thanks Ivan! 🙂 So it would seem that I can at least solve this by setting that $config->tracyDisabled based on my own rules (or just use the same rules by stating that "$config->tracyDisabled = !$config->debug"), and then setting the output mode to DEVELOPMENT (or alternatively forcing development mode for superusers, since that's what I'm usually logged in while developing anyway). Still would seem more "streamlined" if Tracy utilised ProcessWire's built-in debug mode flag, but again there may be a good reason why a more nuanced setup is required. ... although, now that I'm reading the docs more carefully, I'm also wondering if I should just stick with DEVELOPMENT mode all the time. I'm not entirely sure (yet) what's the harm in that, considering that only superusers and users with the tracy-debugger permission should see anything out of ordinary anyway – right? Or is this setting going to do/affect something else? Basically it seems that this setting is useful in case, say, a client is going through the site as a superuser and you don't want them to see the Tracy bar 🤔 -- Another thing I've been wondering – and this is completely unrelated to the questions above – is whether Tracy provides support for breakpoints, as in points of code where execution should stop and display current "state" in some manner? I'm aware of the bd() function, but couldn't find anything pointing to this direction specifically. There is the bp() function, but apparently it's a different concept entirely – more like a timer than a breakpoint, really. Coming from Xdebug I'm used to relying on breakpoints while debugging features that I want to walk through step-by-step, stop before they are fully executed, etc. If the answer is "no", that's fine – I can always just use Xdebug on the side 🙂 Edit: should've kept digging further. Found this from the blog entry introducing Tracy Debugger: I guess that answers my question above, and the suggested solution is indeed a combination of Tracy + Xdebug 😅
  18. Hey @adrian! Sorry if this has been discussed/answered already – tried to browse a bit but there's just so much information here. Anyway, as I've been trying to integrate Tracy into my regular process, I've ran into a bit of a dilemma regarding the "output mode" setting. The thing is that I'm used to displaying errors on screen when ProcessWire's debug mode is enabled, but Tracy seems to override that. The solution to this would apparently be the "output mode" setting, but since in my case the development often happens on a publicly viewable (development) domain, the "DETECT" setting doesn't work for me (as it assumes that my site is in PRODUCTION mode), and I already have programmatic rules in place for enabling $config->debug depending on the state of the site / environment. I would've assumed the debug mode to force Tracy to dev mode as well, but it seems that it doesn't. I guess I'm mainly asking if this would make sense, or if there's a reason to keep Tracy's output mode and $config->debug separate? 🙂
  19. Honestly I don't think that there's any deeper meaning here. Setup is always available and generic enough to contain different types of things. That's just about it. We could probably figure out some other "generic parent", but personally I'm OK with "Setup" -- though I do see your point, and do think that it's a valid concern 🙂
  20. Technically yes, but I'm not entirely sure I like this idea. Perhaps it's just because I'm used to the way the system works now, but if I were editing some content, it wouldn't be obvious to me that if I change the title nothing happens – except if the status of the page is unpublished. Again, this is obviously just something one needs to be aware of, but personally I don't feel that it's intuitive enough. It's quite possible that I'm in the minority here, but I often tweak the title multiple times while the page is unpublished, yet I've already figured out the name I want to give it. Similarly I can sometimes take a page "offline" for a bigger update, and then restore it. In my opinion a clear indicator about what the name (/URL) is, so that I remember to update it if need be, is a better solution 🙂 Note: I have had numerous use cases where a template behaves exactly like Adrian has described above, i.e. name is autogenerated from title. But these are usually specific cases, such as a personnel directory or something like that. Sure. It's not wrong to release a specific feature as a tiny stand-alone module, though – there's a case to be made for modules that do just one thing well 🙂
  21. Related to Tailwind, just stumbled upon https://tailwindcomponents.com/ – thought this might be of interest to someone here. Too bad the first couple of components I checked out were pretty bad in terms of accessibility (inputs without labels etc.) but I bet there are good ones in there as well 🙂
  22. Something along these lines would be great! Nitpicking, but I wouldn't use an icon alone (for accessibility and usability reasons), but other than that it's definitely a feature I'd be using. Idea for a module? 🙂
  23. Couple of related issues: https://github.com/processwire/processwire-requests/issues/144 https://github.com/processwire/processwire-issues/issues/703
  24. The limit of 128 characters has been in place for many years now. Personally I don't see a huge issue in raising it, or at least allowing longer names but making this an optional feature, but in the end that's a decision for @ryan. You can always open a new issue at the processwire-requests repository, requesting support for longer page names and explaining your use case and need for these. I can't remember if the reason for this limit has been discussed before. Browsers have some kind of limits in place, but these days those should be pretty much a non-issue as far as I can tell. Database level scalability probably shouldn't be a massive issue here either. That being said, I must add that this might be the first time I've heard anyone requesting longer than 128 character page names – so while it may seem messed up to you, it seems to me that your use case is actually not a particularly common one. In fact for most sites page names longer than 128 characters would very likely result in usability issues, and – just for an example – for the sort of projects I usually work on I definitely wouldn't want to allow that. 128 characters is already much longer than what makes sense 🙂 As for workarounds, depending on your use case you might be able to use URL segments here instead. That's just one idea, though. The name field in the pages table is varchar(128), so that's at least one place that will enforce the limit.
  25. Actually the fix/change @dragan mentioned above was about URL segments only. Page names are still limited to 128 characters as far as I can tell.
  • Create New...