Trevor Davis
Blog and Portfolio for Trevor Davis
Latest posts
Using localStorage in Remix
I wanted to get some more experience working with GraphQL mutations, so I worked on a new feature for my site that enabled a user to “like” a blog article. I ran into a little gotcha that is kind of obvious now that I know the solution but wasn’t obvious at the time. I didn’t think I needed to be fancy and store the “like” in the database and associate with the user, so I decided that tracking…
Setting Up Live Preview with Craft CMS in Headless Mode
In my previous post , I talked about transitioning my site from being powered by Craft to being powered by Remix and a GraphQL endpoint coming from Craft. One of the best features of Craft is Live Preview , and it took a little configuration to get this working on my new Remix powered site. Remix Configuration These were specific changes that I needed to make on the Remix side, but really it would…
Why I’m So Excited About Remix
I’ve been building on the web for a long time. There’s a part of me that still has a bit of an old school mentality, and it’s hard for me to get really excited about new technology. Sure React was cool when it came out for its state management, but I didn’t see it as the be-all and end-all for building on the web. I really like Craft CMS for building CMS powered sites since I have full control…
MW Components
What I Love & Hate About Tailwind CSS
As a long time skeptic of Tailwind CSS, I’ve finally given it a try and discovered some things I love and hate.
How We Prevent Leaky Templates in Craft CMS
Prevent the flood of leaky templates in Craft CMS with just a little bit of PHP.
Human Rights Campaign
NFL Players Association
Level Up with Craft CMS: Know When to Ditch Twig
If you notice your Twig templates are getting overly complex, it may be time to extend Craft with a custom Module.
Why You Should Update to Craft 3 ASAP
Updating to Craft 3 means new features for your site with improved performance and security. This latest version was released earlier this year, and you should update as soon as possible!
BDI Furniture
Bethesda Creation Club
PBS Kids Development Tracker
Volunteers of America
Managing CSS & JS in an HTTP/2 World
We have been hearing about HTTP/2 for years now. We've even blogged a little bit about it. But we hadn't really done much with it. Until now. On a few recent projects, I made it a goal to use HTTP/2 and figure out how to best utilize multiplexing . This post isn't necessarily going to cover why you should use HTTP/2, but it's going to discuss how I've been managing CSS & JS to account for this…
Open Space Institute
Craft Color Swatches Plugin
The control that Craft can provide a user is what makes it stand out as a content management system. But sometimes we want to limit what a user can choose from. Craft has a built-in Color field which allows a user to select any color from a color picker. There are times when we only want a user to choose from a select number of colors though. Previously we have done this by using a dropdown with a…
Responsive Images with srcset & Craft
Tommy recently wrote about responsive background images in Craft , but I wanted to follow up about how we used the <img> element and srcset to build responsive images on this very site (powered by Craft ).
Pending User Plugin for Craft
On a recent project that was built on Craft , I finally got the chance the kick the tires on building a members-only section with Craft. Out of the box, Craft provides so much user functionality, but the user moderation process wasn’t exactly what the client wanted. Luckily, Craft provides us with the ability to change that process with ease.
How to Survive Working from Home
When I started working here five years ago, we had two offices: one in Falls Church, VA and another in Durham, NC. Now we have a third office in Boulder, CO and a handful of employees, including myself, working remotely. Being set up the way we are, we are all used to interacting with remote team members, but the majority of the employees work in an office. I happily worked from the Virginia…
Front-End Parts Kits in Craft
Pattern library , style guide , UI library, parts kit; call them what you want, but these are essential to building websites of any scale. Typically, this is something you manually construct to demonstrate all the modules and pieces that you have constructed, but I have been investigating ways to make them a bit more dynamic when building sites with Craft .
Why We Love Craft CMS
I decided to write a little post to give some insight into why we love Craft so much at Viget.
Attending & Speaking at the Craft CMS Summit
I’m a little belated, but I was lucky enough to attend and speak at the first Craft CMS Summit two weeks ago. This was the first online conference that I had ever attended, and I was thoroughly impressed. I had always been a bit hesitant to attend online conferences because I was unsure about the quality, but after experiencing it firsthand I won't hesitate in the future. Everything was very well…
Integrating Craft & Shopify
As we have the opportunity work on more Craft sites at Viget, we’ve been able to do some interesting integrations, like our most recent integration with the ecommerce platform Shopify . Below is a step-by-step guide to implementing Craft and Shopify by utilizing a plugin I built.
Reroute Plugin for Craft
You know what's really annoying? Having a million redirects in your .htaccess file. When we build EE sites, Detour Pro has become a part of our builds so that other team members and clients can manage redirects. But, that solution won't really work when you launch your first Craft site for a client !
Getting Crafty
Here at Viget, we have been using ExpressionEngine as our primary off-the-shelf CMS for years. Craft and Statamic , both of which are developed by EE add-on developers, have really caught our attention. We finally determined that Craft would be an appropriate solution for a project, and while building the site, I built a couple small plugins.
You Matter
I’m not sure if it’s a couple of talks that I recently saw at Peers Conference or maybe the fact that I’m just getting older, but I’ve been thinking a lot lately about work/life balance and personal health.
JavaScript Execution Patterns for Non-Web Apps
I finally got back to blogging and wrote an article about JavaScript execution patterns , a topic which I recently presented on at the DC jQuery Meetup .
Who Says the Web is Just for Squares?
I had some fun building a crazy diamond responsive grid for a project at work. This article explains how I did it.
World Wildlife Fund
Dumbwaiter Chrome Extension
I recently got around to trying out Statamic to create a little recipe manager . Yes, I know there are tons of apps out there that do this type of stuff, but I wanted to really be able to control everything. I also wanted to figure out some way that my wife could bookmark recipes for us, and I didn’t expect her to login to my Statamic install and go through that whole process of adding a new…
jQuery Stick ‘em: Make Content Sticky on Scroll, to a Point
I created a plugin, jQuery Stick ‘em , to allow items to be “sticky” but only within a container.
“Advanced” Templating with ExpressionEngine
I was luckily enough to be asked to speak at the DCEERs Day conference yesterday. I was asked to speak about best templating practices, which ended up being a talk about how I use Stash and how I build custom plugins to streamline templating. It was a great day filled with discussion about ExpressionEngine, and it made me look forward to EECI even more!
Sass & Compass: Never Write Regular CSS Again
I gave a presentation last week at Refresh DC about Sass & Compass . After being introduced to Sass & Compass about six months ago, I can’t imagine writing regular CSS ever again. I was a little hesitant at first, but now I can’t live without it. I posted my slides online , and here is the git repo with all of the code samples.
A Long Time Coming
It’s funny how quickly you come to hate your own site. Almost exactly 2 years ago , I launched a redesigned version of my site. After maybe a year, I hated it. But who has time to redo their own site? Apparently it took me 6 months to find the time to finish mine. Even within those 6 months, I found things that I had started on the site that I hated. My goals were to simplify things a bit, make it…
Rumble Games
Ultimat Vodka
Building a Nested Responsive Grid with Sass & Compass
Whether you are a hater of the technique or not, Responsive Design is one of the most important things happening on the web right now. I am finally getting a chance to work on a project where we are taking a responsive approach to the site, and it’s been great, but I have definitely come across a few gotchas here and there.
The ExpressionEngine Side of the New Viget.com: Part 2
I’ve already talked about the EE setup for the new viget.com, but now I want to talk about the code. It took a little longer than I wanted to get to it, but let’s finally talk templates and custom addon development.
The ExpressionEngine Side of the New Viget.com: Part 1
Before I started at Viget, I remember thoroughly enjoying the articles by Doug about building Viget.com in EE. That was really some of my first exposure to EE, and from there I’ve come to love it. My hope is that I can recreate some of Doug’s magic and talk through how I built the current iteration of the Viget site in EE. I know, it’s gonna be hard to do. This post is going to be broken into…
Background-clip, Text-shadow, & Gradients; Oh My!
I have been able to play around with background-clip, text-shadow, and gradients on a few recent projects, and I wrote up some tricks that I have come across.
Notes From Our Default ExpressionEngine Build
I put together some notes about Viget’s default ExpressionEngine build in the hopes that you can find some tips and tricks in all of my nonsense.
Is Ajax ExpressionEngine Plugin
For a recent project, I needed to detect whether a request was an AJAX request or not. MX Ajax Detect already existed, but I didn’t like that you needed the extra set of tags. Usage {if {exp:is_ajax} == "true"} OH YEAAAH {if:else} OH NOOO {/if} Download You can find the plugin on Devot:ee and GitHub .
PUMA
Styling HTML5 Elements: An Irresponsible Choice…Right Now
I figured it was time to post about a controversial topic that had come up recently. I just don’t see the value in using most HTML5 elements right now .
A Couple of Presentations
I’ve given a couple of presentations recently, so I thought I would share them. Mee & EE: Sitting In A Tree An internal presentation given to all of Viget to give an overview of EE and why I love it. Add Some Awesome-Sauce A presentation given to Clarksburg High School students with a supporting demo site to introduce them to some HTML5 and CSS3 features.
PUMA Golf
My New Best Friend: CSS Generated Content
I’ve started to use generated content more and more these days. Here are a couple of examples from a recent project.
So You Want to Use .htaccess files with MAMP?
Well, this was easy in the older version of MAMP that I had. You would just drop them in place, and they worked. I was having a problem with something, so I thought maybe there was an updated version of MAMP that would solve the problem. Sure enough, there was. So I installed it and went along my way. Then, I went back to the local version of my site, and it was completely busted. I finally…