Block on mutiple pages
Permalink
I have created a blocktype where i can add an infinite amount of items to each block instance.
But now i want to display the latest item from a block instance on another page.
How can I do this?
But now i want to display the latest item from a block instance on another page.
How can I do this?
So i would probably have to make another blocktype? And how would i be able to select wich block instance to use?
There are a few different ways to do it -- you could create another blocktype, or you could make a custom template for the page list block, or you could code this into a page type template. It really depends on what the situation is for your particular site.
As for how to select which block instance to use...
My code just uses the first block of your custom blocktype that it comes across. My assumption is that since you said each blocktype has an infinite amount of items, then there would only be one of them on a page. But if that's not the case -- you tell me: how do you want to choose? Do you want it to choose the first block on the page? The last block on the page? Or do you want a manual choice that you can make when setting this up? Or do you want to mark the custom block itself as being worthy of getting syndicated to other pages?
As for how to select which block instance to use...
My code just uses the first block of your custom blocktype that it comes across. My assumption is that since you said each blocktype has an infinite amount of items, then there would only be one of them on a page. But if that's not the case -- you tell me: how do you want to choose? Do you want it to choose the first block on the page? The last block on the page? Or do you want a manual choice that you can make when setting this up? Or do you want to mark the custom block itself as being worthy of getting syndicated to other pages?
Then on the other page where you want to show the recent item from a different page, do this: