Create a .well-known file in Hubspot

August 28, 2024 at 11:35 am | Design, Programming, web.

Certain processes have you create a .well-known folder and file inside at the root of your site. These can be anything from security protocols to verification services. This can be a problem with hosting services that do not allow the creation of the folder or that have site media stored at another URL location such as a subfolder or alternate subdomain.

Here is a quick tip on how to create a file like this inside of a hosting service like Hubspot.

Read more »

How to improve your Marketo subdomain page speed with one checkbox

August 27, 2024 at 1:15 pm | Design, web.

I recently ran across this strange bug while building a guided landing page for a partner. The Chrome inspector console was throwing a mixed content message for a favicon that was coming from an HTTP non-secure URL. I thought, well that is strange because I added all the favicon links right in the Marketo page and they are all coming from and HTTPS secure URLs.

Read more »

Better WordPress search with two quick changes

August 6, 2024 at 9:32 am | Programming, web, Wordpress.

WordPress search is a nice addition to a site and can help your users find the content their looking for rather than hunt through menus or landing pages.

One problem. WordPress search relevance isn’t that great. There are other search plugin addons that you can install like Relevanssi, which can help things right out of the box. But here are two quick things to change about your default posts search that can help your users find what they are looking for faster.

Read more »

Embed youtube video for page speed

July 31, 2024 at 10:23 am | Design, Javascript, Programming, web, Youtube.

One of the problems with embedding Youtube videos into your pages is that they load in all sorts of javascript assets along with you page load even if the user doesn’t click to play the video.

One way to get around this is to use an image to represent the video in the page and don’t embed the Youtube video until the user clicks on the image. This can save your page load as much 1mb- 1.5mb per page load.

Read more »

Expand all Asana comments and threads in a task

May 18, 2023 at 12:56 pm | Programming, web.

You can use the following piece of Javascript as a bookmark in your browser to expand all the comments and threads in an Asana task. This is really helpful when you have long threads with lots of comments and you are unable to see all of them because Asana hides them by default.

Read more »

Fixing preview or unfurl in Slack

February 19, 2022 at 1:48 pm | Programming, web.

Sometimes you will find that certain links in slack do not preview or unfurl inside of a channel or conversation. When you have ruled out all of the basic reasons set forth in the Slack share links documentation setup here here are a couple more that you can look into.

Read more »

Drupal: Get the node/bundle when preprocessing a paragraph

January 20, 2022 at 9:42 am | blabbing.

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 to preprocess a PARAGRAPH_TYPE but only if that paragraph is part of a CUSTOMER node/entity type.

<?php

function MODULE_NAME_preprocess_paragraph__PARAGRAPH_TYPE(&$variables){

  // Get the paragraph
  $paragraph = $variables['paragraph'];

  // Get the Language
  $language = \Drupal::languageManager()->getCurrentLanguage()->getId();
  
  // Get the Node from the request.
  $node = Drupal::request()->attributes->get('node');

  // Check to make sure the node is NOT null before running something like $node->bundle();
  if($node != null && $node->bundle() == 'customer' ){
    // Code
  }
}