Jump to content

Mikie

Members
  • Posts

    191
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Mikie

  1. Hey, what's best practice for saving logs generated by a module? Like if I'm making a module that requires logging for reference, do I save to site/assets/modulename/logfile.text or site/assets/logs/logfile.txt ?
  2. @Robin S was just typing a reply to say I was thinking there might be quick css fixes, maybe more complicated js ones. I was hoping someone with a bit more knowledge of the theme code might know some quick ones, and lo and behold! This is good stuff thanks. Totally get Ryan doesn't monitor the forums but just wanted to see if anyone had any more knowledge of this before attempting to do so myself. Issue / requests definitely the most proactive way to move forward. @wbmnfktr its just little bits and pieces that I feel could be optimized. I am maybe noticing it right now because I am clicking around the admin a lot for a new site. Generally didnt want to bring this up as a major flaw or need for a rewrite, just hoping there might be ways to optimise this stuff. Beyond Robin's suggestions my hunch is there is also probably also some weird interplay between UIKit js and jqueryui going, but I need to dig in and have a look. Thanks all for the feedback, if anyone has any other fixes maybe PM me or post back here, at some point soon I'll put these into issues / requests.
  3. Hey just bringing up as a point for discussion. I find in various areas of the admin there is quite a lot of reflowing of content and flash of unstyled content (FOUC). Examples are: the pages listing animation pushes the footer down the page every time, and this can also be seen on various pages where content doesn't load immediately (footer will fly down the page) basic pages with no fields – sit there and refresh a basic page a few times, you will see a flash of all content before tabs are created pages with lots of fields – progressive loading and rendering of different fields and groups causes lots of reflow, particularly loading wysiwyg and image fields modules eg lister-pro – loads the add new button initially on the left then it jumps to the top right as the lister loads, then columns reflow and resize as content loads in and classes are applied Whilst pw is very fast to render admin page html, to me the above makes it feel quite jarring and heavy. Generally speaking you want to aim for no reflow or FOUC whatsoever for a good user experience. I know there is a lot going on here and it is not a simple thing to manage an admin like this, but does anyone notice the same thing and have any ideas about how this can be optimised? Below are some relevant links. Minimising animations is the best place to start, although before anyone suggests it just using AdminOnSteroids to disable animations doesn't fix a lot of what I am talking about. https://developers.google.com/speed/docs/insights/browser-reflow https://gist.github.com/paulirish/5d52fb081b3570c81e3a
  4. Hey @bernhard ploi does look good and good to get on cheap plans now before they up the price later like these services always do. However when I tried it out they hadn’t set up multiple system users yet, and I found their admin a bit all over the place. I’m sticking with runcloud for now, however with them I’ve had problems trying to amend Nginx configs for their Nginx + Apache setup, they lock you out of certain sections and it makes some things like cache headers hard to customize. Another one that is very different but technically much more secure, optimized and capable is this https://apnscp.com/, but the documentation is literally all over the place. More info here https://amp.reddit.com/r/webhosting/comments/arqya9/built_a_control_panel_over_16_years_free_lifetime/
  5. Hey @dragan and @flydev thanks for the responses. @flydev you solved it. My sanitised variable wasn't beautified and had multiple dashes to replace dirty characters, so the get was failing. Thanks so much for the help!
  6. @happywire check out services like https://runcloud.io or https://ploi.io for managing multiple vps. For deploying code https://github.com/git-ftp/git-ftp works really well for a simple workflow, and syncing files / database up or down can be done in one command with a simple bash script if you have ssh access, there are plenty of references if you search GitHub gists.
  7. Hi there! I'm experiencing a weird problem creating pages via the api. My actual code is a bit more complicated, but the below summarises the issue. Would explicitly setting the name when creating a page cause this problem in anyone's experience? I am doing this for a reason, as I am creating thousands of pages through the api and the page titles have all sorts of characters that break selectors in them. I was experiencing issues both sanitising the titles (titles wrapped in quotations) and searching with sanitised titles, I thought creating a sanitised name variable would help my logic for checking for page existence and let me leave the titles as they were. $title = "Page Name"; $name = $sanitizer->pageName($title); $parent = $pages->get("name=parent"); $p = new Page(); $p->template = "template"; $p->parent = $parent; $p->title = $title; $p->name = $name; $p->save(); $test1 = $pages->get("name=$name,parent=$parent"); // NullPage $test2 = $pages->get("title=$title,parent=$parent"); // correct Page object
  8. Thanks @horst & @szabesz. I wouldn't want to install Admin on Steroids just for this, I actually use your module @horst https://modules.processwire.com/modules/page-tree-add-new-childs-reverse/ but personally I think this kind of thing should be in core. Why not multi-sort? Or at least a site-wide config flag to change default page tree sort from ascending to descending. This is a hurdle I hit every project, and I remember initially when using ProcessWire it was a roadblock until I discovered the modules to fix. It is more developers that are coming from other CMS that I am thinking of.
  9. Would be great to either enable multi-sort for pages in the admin or to be able to set an initial sort order to apply before Manual Drag and Drop. The main goal is for new pages to be added to the top of page listings in the tree when Manual sort is enabled. There are a lot of historical posts about this in the forums, and I keep hitting this hurdle when I try to migrate clients from other CMS to PW. It is actually almost a dealbreaker for them wanting to use PW. I have never actually had a job where it was possible to sort by date created / published by itself. For example I do a lot of sites for creative clients who have listings of "projects" and want the admin to look like the front-end (most recent first), but like to retain the ablility to tweak the order of their latest jobs. Thanks!
  10. Agree with this. The logotype should stay top left on all pages at all times, it's a design pattern that users are used to and expect.
  11. I also don't necessarily agree with design by committee, but since this is the first thing you see I feel obliged to dive in... Personally the iMac sans apple branding is a bit weird for the landing page gif since you end up with a big grey bar wasting space, and so much screen realestate is taken up by the display itself and not the content you are trying to show (pw in action). Also, it is such a ubiquitous image that most people will automatically notice something is off, and there may actually be legal ramifications for doing this. Not sure what the solution is, I'll have a think and pm you. Secondly, the poor quality and artifacting in gifs are really noticeable, especially on retina displays, and nothing can be done to be rid of them. Have you though of a <video> for this? This is also an interesting solution: http://www.sublimetext.com/~jps/animated_gifs_the_hard_way.html I'm pretty sure someone will have turned the above into an easy to use library and put it on GitHub. Otherwise, as mentioned, great work!
  12. Hey @ryan, Looks great, will be a much easier sell for prospective clients. Well done! Just flagging that categories accessed by the dropdown menu on the Sites page aren't working in the demo. Directs to /pwsite instead of /newsite. Tried to search to see if anyone had flagged this, apologies if doubling up.
  13. Not sure, but I think they’d be smart enough to recognize the same card. That credit would cover multiple projects tho.
  14. Mikie

    Manager.io

    For all the reasons people here love ProcessWire, thought I'd share a great accounting app with a similar feel / philosophy. It's called Manager https://www.manager.io and it is amazing. I used to use it years ago and am now moving back from Quickbooks, it almost makes me enjoy doing my books.
  15. I only use Cloud for Compute and Storage (the billing is really flexible), but looking here it seems that credit is per billing account: https://developers.google.com/maps/billing/understanding-cost-of-use
  16. Hi @bernhard, I appreciate and understand all your comments, but I feel like you are missing the point. There are two concepts/workflows at play, and whilst they aren't mutually exclusive they do serve different purposes. Migrations = manually migrate config and content changes by writing php using the API JSON Export/Import = automagically migrate config (not content!!!) changes you have made in the admin panel Both have pros and cons and in some situations one or the other may not even be viable, therefore the choice is important. I personally wish you could export field definitions as php (like you can with ACF), which is sort of a middle-ground between both these options. To be clear, my feature request was just about updating current core Import/Export to (optionally) enable a more seamless workflow like the below screencast. In it I migrate a new field defined in the admin from one wordpress installation to another in seconds. You cannot do this with Migrations, and with version control and the right logic for syncing this is a completely viable way to migrate config. I am not suggesting this should be the canonical way to migrate config, just one option that sits alongside something like Migrations.
  17. @arjen I agree with this, it is by no means perfect. Eg with ACF if you have latest database but old json then you will be prompted to sync changes (which would be reversion). I feel like this is a shortcoming with the ACF implementation though, surely field updates could be timestamped? Maybe I am not thinking the complexities through. However for a single dev its pretty simple, and with multiple devs there should always be a repo and database that can be considered the source of truth. If things get out whack just pull from latest.
  18. Thanks @bernhard, I've added my thoughts over in that discussion:
  19. Since I posted a feature request for something similar without knowing this discussion was happening, just thought I'd chime in. Obvjously json sync has drawbacks, but here is the workflow I have experienced using ACF with Wordpress that works really well: LOCAL (clone of REMOTE) | REMOTE (source of truth) LOCAL - work on fields and perhaps content / other config such as templates LOCAL - check auto generated field json into version control for other devs to pull, or push to REMOTE as part of deployment REMOTE - sync field updates in admin, and if other config / content mismatches then things fail gracefully To explain the last step, say you have added the field to a template on LOCAL that doesn't exist yet on REMOTE, then on REMOTE nothing goes wrong and if you re-save the field on REMOTE it just updates to the current state there. This is about syncing fields, not other config, so things should just fall back to default if relying on other config that could conflict. I can definitely see how content (not other config) can quickly become a problem when moving outside of this workflow, but if all you are doing is testing things locally, pushing to live, then syncing the database from live back down to local, this is a really quick and efficient way of iterating field updates and sharing with other devs.
  20. It would be handy to automate import and export of fields across installations. The reference for this is the wp ACF json functionality, which in practice allows checking field changes into version control and syncing field config updates without having to worry about the database. This would be achieved by automatically creating json export files when saving a field, checking these json files for changes in the fields list, and providing ui to import the changes if wanted. It seems like a module could easily manage this using available hooks, but just wondering if others would find this handy or if it is on any sort of roadmap. Sorry if I am doubling up on this, there is lots of talk around different modules like Migrations but nothing specifically about automating current field import / export functionality.
  21. Hey @Tom. JAMstack itself is just a marketing term created by Netlify’s CEO to onboard people onto their hosting platform and CMS. Netlify CMS is not really a CMS, it is an admin panel that integrates with static site generators like Hugo and Jekyll. The use case for static site generators is usually very simple sites with basic structured content like blogs and portfolios. See examples here https://jamstack.org/examples/ The JAMstack methodology also encourages using cloud CMS platforms like Contentful, however there are benefits and drawbacks to this I won't go into. To set up something like what you are asking about (but way more fun and flexible) with Processwire, imagine you have a domain http://api.website.com pointed to a Processwire instance with a homepage template like this: <?php namespace ProcessWire; header('HTTP/1.1 200'); header('Content-Type: application/json,charset=utf-8'); header("access-control-allow-origin: *"); $data = []; $projects = $pages->find("template=project"); foreach ($projects as $p) { $data[] = [ $title -> $p->title; $content -> $p->sometextareafield; ] } echo json_encode($data); and the main domain http://website.com is just a static hosted at netlify and your index.html contains the below: <body> <div id="projects"></div> <script type="text/javascript"> $(document).ready(function() { $.ajax({url: "http://api.website.com"}).done(function(data) { var $projects = $('#projects'); data.forEach(function(project) { var html = "<div class='project'>" + "<h2>" + project.title + "</h2>" + project.content + "</div>"; $projects.append(html); }); }); }); </script> </body> ... then you have the beginnings of a single page javascript app. Of course building an entire site like this and incorporating routing and state management etc would become tiresome very quickly in jQuery, which is why javascript frameworks like React and Vue exist. Regarding build tools and task runners like Webpack and Gulp, they exist to do what they say, i.e. bundle up static assets or run tasks. Before getting to that tho, it is important to understand the way people use node and npm for front end dev. See this article maybe: https://www.impressivewebs.com/npm-for-beginners-a-guide-for-front-end-developers/ I personally hate Webpack, I use npm scripts and the CLIs of my preferred libraries to do everything. I can post an example if you like, but these blog posts sum it up: https://deliciousbrains.com/npm-build-script/ https://www.keithcirkel.co.uk/how-to-use-npm-as-a-build-tool/
  22. What source control do you use? For jobs where client are on shared hosting https://github.com/git-ftp/git-ftp works really well for basic deployment and even rollbacks if necessary, I can tell you my workflow with it if you'd like but it's pretty simple. Re the database, not sure exactly what you are after. If I have ssh access I use a bash script I based off this one https://gist.github.com/samhernandez/25e26269438e4ceaf37f to sync local and remote databases and files. I use it to pull down latest state from the server, but you could also use it to push from local I guess, or sync between staging and live.
  23. Thanks for the update. Makes sense you want to keep this functionality in that separate.
  24. Hi @kongondo, sorry for any confusion. I am purely talking about a frontend account area for customers where they can review orders, manage account info etc whilst staying on brand to the look and feel of the shop. When I mention authentication I meant incorporating a login / registration flow similar to Ryan's Login/Register module. See some screenshots from WooCommerce Storefront theme below. The code for this is here, but I can spin up a demo for you if you want.
  25. Excited about this. One feature request that I am not sure is covered above (apologies if I missed it and am doubling up) is a front-end customer account area. Again, woocommerce is a good reference point for the basics involved. A separate optional module would make sense, and ability to style / customise as needed would be important. Maybe it could be less of a predefined account area and more of a module to manage users, authentication and customer endpoints on the frontend.
×
×
  • Create New...