Jump to content

Tom.

Members
  • Content Count

    441
  • Joined

  • Last visited

  • Days Won

    7

Tom. last won the day on August 22

Tom. had the most liked content!

Community Reputation

603 Excellent

About Tom.

  • Rank
    Sr. Member
  • Birthday 11/01/1992

Profile Information

  • Gender
    Male
  • Location
    England
  • Interests
    ProcessWire

Recent Profile Visitors

3,557 profile views
  1. Here is a crazy one for me. I've worked with ProcessWire for years and I have never come across this. I had my website installed on one sub-directory and I moved it to a different one, but all the links in the admin panel other than the home and edit page buttons are linking to the old sub-directory. I always believed that the urls were relative. Has anyone come across this before? I don't know where to look to fix this as the url isn't anywhere like it would be in WordPress for example. I've tried refreshing my cache. EDIT: Nevermind, tried incognito and it worked fine, so it must be a caching issue.
  2. You can get UIKit purged down to ~25 - 40KB.
  3. Hello everyone, Recently I spent some time researching how I can update my workflow. I really enjoy working with TailwindCSS however, when it comes to Javascript, I often find myself having to search around to find a good package. Often I find myself having a package for lazy loading, a package for sliders, a package for animation, a package for parallax and a package for ajax. Before you know it, you are worrying about dependicies, conflicts and vunrabilities for many different packages. Since the push is to get rid of jQuery and use native javascript, often each will have their own utility classes, some of which do the same thing. This adds a lot of bulk to the website. This is what I love about UIKit, it provides plenty of functionality for a small ~130KB unminified. Not many know this, but the UIKit helper classes are exposed via the API too. So it means you will not have to worry about your javascript working cross-browser (https://github.com/uikit/uikit-site/blob/feature/js-utils/docs/pages/javascript-utilities.md). The perfect thing would be to combine UIKit and TailwindCSS, but the best way to achieve this is up for grabs. I personally use TailwindCSS base and implement components from UIKit. I then use PurgeCSS on the CSS file to make sure anything unused by either UIKit or Tailwind isn't making it to production. I do this using Parcel JS. I have used Webpack and Gulp previously, but I find Parcel is a simple and easy way to get a project started (and it's fast!). The next thing I've found is UIKit is not always the answer. There are now more than ever better ways of achieving things in browser. Such as CSS Grid, `position: sticky`, and `object-fit` try to use these CSS alternatives where possible. Purge will always make sure that you get the smallest possible file size, so avoid using the uk-grid element where possible and use CSS Grid. I have setup a github starter template (https://github.com/TomS-/UIKit-TailwindCSS/tree/master) if you want to have a look at it. CSS Grid will introduce intrinsic design (https://www.youtube.com/watch?v=lZ2JX_6SGNI - Great series) Next will be to use WebP, there is plenty going around on the blogs now about this, but this will make a massive improvement to your Google Page Insight rating (https://developers.google.com/speed/pagespeed/insights/?url=https%3A%2F%2Fwww.tikari.co.uk%2F&tab=desktop). I would love to hear your web manifesto - and ask me anything about mine 🙂
  4. Hi Jeevanish, For the most point some of these are just buzz words. Headless CMS is basically the CMS exists away from the website and talks via an API such as JSON / XML / GraphQL (This allows you to use the data anywhere on the web or an internet connected drive, lets say for an APP) Hybrid CMS is something that seems relatively new, and it seems to be that Headless CMS doesn't have great editor functionality, hybrid seems to be a buzz word around it's a great easy to use CMS with Headless functionality, I guess if you installed GraphQL to ProcessWire it would be considered hybrid. Digital Experience Platform seems to be a platform that all talks to each other using different mediums. Lets say you have a train station, that system lets you book a ticket, that then updates a message board letting them know how many tickets are left, which updates their website and also sends to the ticket attendents which shows that the ticket is for that train. This is just an example. This system can be accomplished with Headless or Hybrid.
  5. I'm talking about the granularity of the margin/padding's but also how hard it can be to follow the classes, without changing my markup to something like: <div class="m-2 md:m-4 lg:m-8 p-2 md:p-4 lg:p-8 block sm:flex sm:align-middle lg:align-top sm:text-center lg:text-left"> <h2 class="mb-2 md:mb-4 lg:mb-8 text-md md:text-lg lg:text-xl"> Title </h2> <p class="mb-2 md:mb-4 lg:mb-8 text-sm md:text-md text-grey"> Some text here </p> </div> I find that when it becomes inline it becomes hard to follow. Personally when I think grid becomes more widely accepted, there is going to be a combination of grid and utility first-css. If I'm understanding correctly, when I took this approach, I felt it overkill for the simple websites I create. For web apps I can see how this would work as it has level of complexity to it. Twitter I have no doubt will be taking an approach similar to this. Personally I currently use "snippets" and include them in PHP with ProCaches static caching to help the server response time. I've been hitting 99/100 on Google PageInsights with this method.
  6. I'm seeing this trend more often. I feel like it's bridging the gap between prototyping and production. When prototyping, using a lot of divs and a lot of classes doesn't really matter. It's about getting the job done quick. But now it seems this way of thinking is making it's way into websites. Things like TailwindCSS (https://tailwindcss.com) is making strides because you can easily tweak margins, paddings, without having to create loads of classes to manage. It falls down however when you have to make global tweaks or responsive tweaks, but you have to go though every element and replace the classes. This means it's better to use Vue as you can create components, but then you run into things like trying to do server side rendering and SEO issues. Sometimes the solution is worse than the problem. Bigger companies have the man power to manage something like this. Don't get me wrong I love TailwindCSS, but for me it's fallen down later in a project where I've found it's just taken me too much time to tweak and keep track of everything. I personally still use UIKit, as it comes with a lot of tools at my disposal (Parallax, Sliders, Models, Tooltips) something I would otherwise have to use an amalgamation of different modules. People at Statamic (https://statamic.com) are doing a great job at keeping on top of emerging technologies and I do hope that ProcessWire eventually finds the time to update it's admin interface, things like jQuery UI should be dropped now as well as the use of jQuery in my opinion. AirB&B was a company I always looked up to, they were doing great things like setting Javascript Guidelines that companies could use so they didn't have to create their own, but even their website is now looking like Twitter (https://www.airbnb.co.uk). It seems to be this the "modern web", but it just looks scary to me.
  7. This will not work as @horst correctly pointed out, it will not work with ProCache. I'm looking at the .htaccess method however, it doesn't seem to work if it is running in a subdirectory # Output WEBP image URLs from ProcessWire, but redirect them to the # JPEG or PNG when the browser does not support WEBP. RewriteCond %{HTTP_ACCEPT} !image/webp [OR] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{DOCUMENT_ROOT}/$1$2$3/$4.jpg -f RewriteRule ^(.*?)(site/assets/files/)([0-9]+)/(.*)\.webp(.*)$ /$1$2$3/$4.jpg [R=307,L] RewriteCond %{HTTP_ACCEPT} !image/webp [OR] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{DOCUMENT_ROOT}/$1$2$3/$4.png -f RewriteRule ^(.*?)(site/assets/files/)([0-9]+)/(.*)\.webp(.*)$ /$1$2$3/$4.png [R=307,L] .htaccess rules are definitely not my strong point. Though I've noticed %{REQUEST_URI} mentioned. What is the correct way of getting it to work in a subdirectory?
  8. Hey @ryan, Just wondering if you saw my update to the WebP functionality? https://github.com/processwire/processwire/pull/145
  9. Another good WebP strategy would be to use: if( strpos( $_SERVER['HTTP_ACCEPT'], 'image/webp' ) !== false ) { // webp is supported! } This would be good paired with webp->url, so it will fallback to the default image if it isn't supported. EDIT: Pull Request - https://github.com/processwire/processwire/pull/145
  10. Confusing one, $page->index() works, but in a repeater item, looping through them and getting $item->index() returns fatal error too few arguments passed. It's using WireArray index rather than PageArray index. It's the first time I've come across this, and it's the first time I've seen an inconsistency in the API. You would imagine that both return an index value if empty. But I always thought a repeater returned a PageArray anyway? It might be worth I'm using the render method, so I'm unsure whether that makes it come through as a WireArray? either way, anyone know how to get the item index for a WireArray?
  11. I got it working using a different file - strange one - there must have been something wrong with the original file, but what that is I don't know as it works otherwise. I've attached the file. SampleVideo_1280x720_1mb.mp4
  12. @wbmnfktr I added another field with the same settings to see if it was mod security, but the same issue happened. Spoke to the hosting company and they said no firewall rules are being hit. The files have extensions and it's not working for the client either. I'm using Chrome 😕
  13. I'm having an issue where I can't upload an MP4 or WebM on v. 3.0.132 in a repeater. It's only uploading 10kb then giving the error "/tw/login/page/edit/…utfieldFileAjax=1:1 Failed to load resource: net::ERR_CONNECTION_ABORTED" I thought it might be hitting the max upload, but it's not, I tried a 1MB MP4 it still failed at 10kb. Anyone come across this before? EDIT: Doesn't need to be in a repeater, just isn't working
  14. @ryan I can't seem to get this implementation working correctly? webpUrl returns the webp image but webp->url returns the jpg.
  15. Hi @ryan do you have any plans on implementing @horst webP support? I'm usually updating every Friday, but this is now preventing me.
×
×
  • Create New...