How to call a Stack and call a Block within that Stack or a list of Block within that Stack.

Permalink
This is what I'm trying to figure out. I went to Andrew's blog and what a joy it was to see that I can hard code a Stack for use on single_pages.

Simply make a Stack, name a stack and add a block to it and you can hard code what you need that way. But I got to thinking. How can I call a Block within a Stack. Or how can I call a list of Blocks within a Stack.

I'm going to continue researching this because I have so many ideas for some custom Add-ons that I want to design using RWD(Responive Web Design) techniques.

Could use some help. More like some guidance in this area.

SoulDesigns
 
mnakalay replied on at Permalink Reply
mnakalay
Hey SoulDesigns,

Sorry to bump up such an old post but did you get an answer on this one? I know it's now possible to call specific blocks within a stack since 5.6.x but no idea how.

Any idea?

Thanks
SoulDesigns replied on at Permalink Reply
SoulDesigns
Here is what I'm trying to do in a nutshell after so long. In javascript I know how to use a for loop to step through each item in an array.

So I'm looking at using Stacks the same way but I'm not that great in PHP to get the same effect since I can't find my PHP VQ book anywhere in the house.

I want to create a Stack that houses Blocks that I want to use and hardcode into my themes. But I don't want to just call the Block... that would be too easy and prone to some issues I foresee later down the road. That method also limits my designs.

I want to still call the Stack and then make a call stepping through the Stack to call a Block within the Stack. If I could do that the sky is the limit in some of the ideas I have for some designs.

I know that if I use this code
<?php $stack = Stack::getByName('Navigation'); $stack->display(); ?>

I can call a Stack but it forces me to have only one item in the Stack. For example: if I were to hardcode a site main navigation and it was in a Stack I could call to it using that code but I would be calling the Stack not the Block.

I want to first call the Stack and then make a call through and within the Stack to the Block within. After so long I really could use help writing a script to make this happen.

Still trying, I think I will purchase Stack Tabs and see how the creator is calling the blocks within but I don't have the funds for that right now. I would love to see the source code because I can read PHP somewhat but can't code it.
JohntheFish replied on at Permalink Reply
JohntheFish
5.6 (or was it 5.6.1) provides a means of selecting and inserting one block from a stack, so would be a good place to look for the code to do that.
SoulDesigns replied on at Permalink Reply
SoulDesigns
I had tried this method before and it didn't work. Abandon all hope ye who enter this idea.