Site logo

[Support request] Reusable Blocks with different queries?

Home Forums Support [Support request] Reusable Blocks with different queries?

Home Forums Support Reusable Blocks with different queries?

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #2482036
    Alejandro

    Hi,
    I suppose that this has been asked a thousand times, but I still have a doubt.
    I do have over a hundred pages in which the structure is the same except the query (based out in tags).

    Is there a way to use reusable blocks / global styles / or whatever, to re-use the same structure changing the query?

    https://imgur.com/a/HrdHIMr

    Thanks!

    #2482044
    David
    Staff
    Customer Support

    Hi there,

    sorry i don’t quite understand what you mean.
    Do you have an example that illustrates what you need ?

    #2482055
    Alejandro

    Hi David,
    Ie, I have these 3 pages:
    https://proyectoviajero.com/continentes/america-del-norte/estados-unidos/
    https://proyectoviajero.com/continentes/america-del-norte/canada/
    https://proyectoviajero.com/continentes/america-del-norte/mexico/

    Now, I want to change a little bit the design and I have to go one by one in changing some blocks.
    The structure of the 3 is the same except for the query: the posts are pulled out based in tags (being these: USA, Canadá and México).

    Is there a way to set up a reusable block or global style or whatever to replicate the same design? (with different queries for the different pages).
    I want to avoid in the future to change pages one by one.

    Thanks!

    #2482071
    David
    Staff
    Customer Support

    If you select all the blocks within the Post Template block, and Convert it to a Reusable Block.
    You can then use that in any Query Loop block and in the future just edit any one to update them all.

    #2482079
    Alejandro

    But if I do this, the system will respect the different queries in the future?
    I guess that I am missing something….

    I mean: the reusable block is EXACTLY the same all over the site right? If I change one setting (a maring, a query o whatever) it will be populated in all the posts/pages where the reusable block is placed right?

    #2482414
    David
    Staff
    Customer Support

    Reusbable blocks are kinda a template part, if you change one instance of them on any page then all will update.
    For your needs – see here:

    https://www.screencast.com/t/P7nqZceybD

    Make a reusable block to go inside the Post Template block.
    Then the Query Loop itself is not linked to the reusable block, and you can have different query loops on different pages but they all display the dynamic content from the reusable block.

    #2483354
    Alejandro

    Got it.
    Thanks David!

    By the way: do you have search queries capabilities to search by post context / information?

    #2483745
    David
    Staff
    Customer Support

    Do you have an example of that ?

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