Site logo

[Resolved] Block Element-Content Template vs Block Element-Loop Template

Home Forums Support [Resolved] Block Element-Content Template vs Block Element-Loop Template

Home Forums Support Block Element-Content Template vs Block Element-Loop Template

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #2473671
    Stefanie

    Hi there,

    I’m confused about the two Element types “Content Template” and “Loop Template” and I don’t know when to use which type.

    I’ve read the documentations, but am still confused about it.

    https://docs.generatepress.com/article/block-element-content-template/
    https://docs.generatepress.com/article/block-element-loop-template/

    In all these videos here: https://docs.generatepress.com/article/block-element-content-template/,
    the type “Content Template” is used to display post-loops. But to display post-loops, shouldn’t you use the block type “Loop-Template” for that?

    If I want to design a post-archive, I would intuitively use the “Loop-Template” type for that. But in your videos only the type “Content-Template” is used.

    Are there other use cases for the “Content-Template” type? And what exactly is the difference between these two types, or when do you use which type?

    Thanks for clarification
    Stefanie

    #2474053
    Leo
    Staff
    Customer Support

    Hi Stefanie,

    Excellent question 🙂

    Content template: This option allows you to change the appearance of each of the blog post block on the posts page. It does not replace the default blog page structure or the loop structure.

    You would not use a query loop block within a Content Template.

    Loop template: This option basically gives you a clean slate of the posts page and allows you to edit it like a normal static page.
    For example, you can add 5 query loop blocks to display 5 categories on the posts page and that would replace the default blog page structure or the loop structure.

    Let me know if this makes sense 🙂

    #2474640
    Stefanie

    Hi Leo

    thank you for your answer.
    Yes, now it is starting to make sense to me 😉

    I’ll try to reproduce what I understood:

    1. Content template: if I want to create a post-archive, then the content template is “only” used to influence the design for the single tile (card).

    2. Loop-template: if I want to create a post-archive, then I can’t use the Loop-template to influence the design of the tile (card), but “only” to influence the structure of the whole page. E.g. I can put an explanatory text above the loop. Is that it?

    3. And what do you mean by “you can add 5 query loop blocks to display 5 categories…” Would be a use case for this maybe this?: A page “Recipes” and on this page the 3 most recent posts from the categories “vegetables”, “fish” and “meat” are displayed (each with a link “Show everything from this category”).
    That would actually be awesome!
    Are there any other use cases for the Loop template? Or can I find a video somewhere?

    #2475067
    Leo
    Staff
    Customer Support

    1. Yes

    2. Yes

    3. By default, WordPress displays the most recent posts on the blog page and a content template allows you to change the appearance of those recent posts.

    However, if you would like to change the default structure and display the most recent posts from 5 categories separately, then a Loop template and query loop blocks can be combined to achieve this.

    Unfortunately there is no video currently – you have a decent understanding to go ahead and try it though. It’s the best way to learn!

    #2475997
    Stefanie

    Hi Leo

    I have now experimented a lot with the loop template and am making good progress. The difference has now become really very clear, thanks for your support!

    I have found two good videos on the subject here:

    https://www.youtube.com/watch?v=KnIOfBYAZ8Q
    https://www.youtube.com/watch?v=nBus9Z4UmI0

    Thanks again!

    #2476336
    Leo
    Staff
    Customer Support

    No problem 🙂

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.