Show recent block from stack in another page
Permalink
i have a stacks and its filled by custom block.
i want to show newest block from that stack in another page.
how to do that?
thanks in advance.
i want to show newest block from that stack in another page.
how to do that?
thanks in advance.
The universal content puller add on should be capable of this!
Thanks for the recommendation. At the moment Universal Content Puller doesn't have a source plugin that will pull individual blocks from a stack, but it should be fairly straight forward to add and adding a 'most recent block' selection is a good idea.
This sort of functionality is usually done with a whole bunch of small pages hidden from navigation, searching and the sitemap. You then add pages for each content block and use a page list to pull the most recent, most likely Page List Teasers as it pulls the real content. Set that up to list by date, not link, and show only 1.
You can see very similar done with most Blog and News setups, except the list is longer than 1 and has links to the subpages for each post.
This sort of functionality is usually done with a whole bunch of small pages hidden from navigation, searching and the sitemap. You then add pages for each content block and use a page list to pull the most recent, most likely Page List Teasers as it pulls the real content. Set that up to list by date, not link, and show only 1.
You can see very similar done with most Blog and News setups, except the list is longer than 1 and has links to the subpages for each post.
Is there any function in Concrete that can do that without using add on?
actually... Build that stack how you want it, then make your new page that you want the newest block to be on. Click to add a stack and select the stack you created. Click on "Individual Block" and select the newest block.
Now every time you add a new block to that stack, just go to the "newest block" page, remove the old block and repeat the "add stack process" for the newest block!
Now every time you add a new block to that stack, just go to the "newest block" page, remove the old block and repeat the "add stack process" for the newest block!
Thank you. It work. But what i want is the newest block update automatically without user have to select individual block and then remove to show the newest block.
Basically i think that i should get the stack, get all the block in it and then select first block from that stack.
I want to do it with hardcode.
All i know about stack just :
Is there any function i can use besides?
And where can i find documentation about stack function?
I have looked in official documentation page from concrete and didn't find anything.
Basically i think that i should get the stack, get all the block in it and then select first block from that stack.
I want to do it with hardcode.
All i know about stack just :
$stack = Stack::getByName('Stack Name'); $stack->display();
Is there any function i can use besides
$stack->display()
And where can i find documentation about stack function?
I have looked in official documentation page from concrete and didn't find anything.
here is an option...
When you are adding your blocks to your stack, you need to click "custom template" and give the newest one a name like "newest" then where you want to call the "newest" block add:
Then when you are updating your stack make sure to remove the block name from the old "newest" and add it to the new "newest" ;)
Thats about as "automated" as it gets as far as i know!!
When you are adding your blocks to your stack, you need to click "custom template" and give the newest one a name like "newest" then where you want to call the "newest" block add:
<?php Block::getByName('Newest')->display(); ?>
Then when you are updating your stack make sure to remove the block name from the old "newest" and add it to the new "newest" ;)
Thats about as "automated" as it gets as far as i know!!
I have tried that.
But didn't show anything in other page.
Is there any other way to select individual block from stack with code?
Besides add area then add stack then select individual block as you mentioned before.
But didn't show anything in other page.
Is there any other way to select individual block from stack with code?
Besides add area then add stack then select individual block as you mentioned before.