Blender: Keep Material Image from Stretching

I found it odd that the default behavior for a material that uses an image in blender stretches, instead of tiles. So for instance, if I have two cubes with one of them twice as large as the other, and I apply a material which uses an image of bricks, the larger block will have bricks that are larger than the other. Of course we want the bricks to be the same size, so I need the image to tile itself as opposed to stretch.

It took quite a bit of searching and it takes a little bit of work (I was hoping for just a checkbox for “tiled” or “stretched”, which of course doesn’t exist).

Step 1: Go into the shading view

Step 2: Set the nodes just like this
(To add these boxes, go into the “add” menu and search for the various nodes you need to add, in this case, you’ll need to add “Mapping” and “Texture Coordinate” (assuming you’ve already added the image). Then make sure the nodes are connected in the same way as below, and that all of the various settings are the same (I think I had to change the “Scale” in the mapping node and set it to “Box” with a “Blend” of “0” in the Image Texture node.