Warning: session_start(): open(/home/forge/legacy.concrete5.org/current/web/files/tmp/sess_1k34lfq1kuko0noo366pd67am2, O_RDWR) failed: No space left on device (28) in /home/forge/legacy.concrete5.org/releases/20170627005447/web/concrete/startup/session.php on line 43
Hardcode Stacks into theme - concrete5

Hardcode Stacks into theme

Permalink 2 users found helpful
Not sure if this is possible but can Stacks be hardcoded into a theme like scrapbook items could. Can't seem to see a way of doing it.


View Replies: View Best Answer
arcanepain replied on at Permalink Best Answer Reply
Yep...this is easy enough to do, and Andrew has actually detailed the code + process for us on his blog:


In a nutshell, simply created a new stack with a helpful name, add blocks to it as necessary then, as shown on page linked above, simply stick this PHP into your theme where you want the stack to appear!

Eg. create new stack named 'Test Stack'. Add blocks and approve.

In your theme/templates:

$stack = Stack::getByName('Test Stack');

Please note, code above is for 5.5.1...code for 5.5.0 is slightly different, but is also detailed on Andrew's blog post.

Good luck!
abovecreative replied on at Permalink Reply
Great stuff, thought it must be possible. Thanks.