Nyhet
Repeat something multiple times
dec. 26, 2020

Repeat something multiple times

  1. For these types of patterns, you will often want the styling of all like Elements to be similar. For example, if the featured image has a slight border radius and the title has the font size bumped and some top margin to push it away from the image, you would have to copy and paste those exact same styles across all Elements every time you wish to make a change.

Basically, none of that is ideal for achieveing that type of laying and making it consistent from a design / data standpoint. Instead, what would be (way) easier is to setup one “instance” of how each post should look and what data it needs, and then repeat that as many times as you need. We will talk more about this below in the Looper Consumer section.

Alternately, there are plenty of other instances in web development where you want to repeat something multiple times and all that is really changing is the content for each piece, but you’d like the styling to remain consistent. Take the following feature list as an example: