Keeping order of blocks like in backend Fairly new user here.
I am kinda confused how to template. I want to rearrange the order of blocks in my backend and show them in the right order in the front.

Here is how i am currently writing a template.


Created a section called "Homepage"
Then I made a matrix block "content blocks"
After that I created 3 Blocks and called them "Image left", "Image right", "Full Text"
Went into my _entry.html and wrote some for loops. Example


{% for block in entry.contentblocks.type('imageLeft') % }
    do something
{% endfor %}


Now when I order those fields in my backend it won't show the right order on my frontend.

Example:

Backend order:


imageLeft
imageRight
imageLeft


Frontent view:


imageLeft
imageLeft
imageRight


I know this is happening because the first for loop will check all first and print them one after another before moving to the next for loop.

How do I prevent this?

I seriously hope somebody understands my issue.  I am fairly new to Twig and Craft so I take every pointer I can get.
I wrote a switch condition in my for loop and everything went well. My bad!