I’m trying to build a blog scenario where I would like to display each subpage (depending on it’s template) with a different layout and not really sure how to do it.
For example template1 will be posts with only images, template2 video, template3 text.
I’d suggest to use snippets for each different template, then you don’t need all the if statements and can call the snippets via the intended template.
Let’s assume your video posts are created with a blueprint video-post.yml, your image posts with image-post.yml etc., then create the following snippets:
Other options for creating different types of posts include using the modules or the page-builder plugin. However, using snippets is perfectly fine and you don’t rely on plugins.