If you need to preprocess a specific paragraph type for it’s content or fields but you need to know the node/entity type that the request is coming from you can use the following. Make sure that you check to make sure the $node is not NULL before running methods against $node. Here we are going… Read more »
Posts By: admin
CSS selector for lang :not en/english
This type of CSS selector can be useful for when you have a multi-lingual site and some content or features may be different between the EN (english) site and other languages. Without having to explicitly name each language in the selector you just want to say “everything that is not EN”.
Load the fonts first for page speed
To increase page speed for blocking font rendering and to reduce the font rendering time when the page loads on your site, add your fonts as a preload at the top of your page. This may seem counter intuitive to load an asset ahead of time for page speed, but it makes sense in two… Read more »
Triggering javascript on change programmatically and have it bubble
A problem I ran into recently is that updating an input value is a form using javascript or jQuery is fairly easy but sometimes this programmatic update of the field does not trigger an onChange event that another piece of code is listening for. Adding a dispatchEvent on the selector can accomplish this.
Working with Hubspot forms onFormSubmit
Getting values from the hubspot form in it’s onFormSubmit handler can be pretty tricky so here is a quick tip. Add the onFormSubmit closure function to the hbspt.forms.create script and then use .find() to get the value of individual form elements that you need. At that point you can use them to pass to tracking… Read more »
Finite and infinite games
Something I ran across recently that I liked. There are two types of games: finite games where rules are known and an end is set, and infinite games, where the rules can change and the end is unknown. Your outlook/beliefs will determine the game you believe you are playing.
Stop animating all your pages
You know that feeling when you get to a site and there isn’t much there and then you start to scroll and POW everything comes flying into the page in all directions. Yeah. Stop doing that.
Simple JS based resize calculator
I made this image resize calculator because I was always going into Photoshop to recalculate an image size and maintain the aspect ratio. https://www.fuzzyraygun.com/resize.html
Fix for svg background images in IE11
Problem: Sometimes SVG images when used as background images do not show up correctly in IE11. This can sometimes show up as not covering the specified element background. The trick here is the add the height and width back into the SVG as it might have been stripped out. Take the height and width from… Read more »
Git and WordPress on a shared hosting environment
If you have a small blog or series on blogs on a shared hosting environment and and want to take advantage of GIT but still want to let your hosting provider keep your WordPress up to date, you can easily setup GIT repos and deployment to make your life easier. Shared hosting services are great… Read more »