Stack in a Automated Job
Permalink 2 users found helpful
So the job is running (Type AbstractJob), so far so good....
Now, the jobs job is to send some emails to some users.
The problem is, when I try to load a Stack into the job:
Calling is fine, gives me the stack object, but calling the method on that object gives me the following error:
Edit:
I give the block in the stack a block name (handle)
under Admin -> Blocks & Stacks -> Edit Modus (on a block in the stack) -> Advanced
then I call it like so:
I had a look into Page/Area/Block/Collection/... classes, but no luck.
How can I put a Stack's block type "Content" into a variable as string?
Now, the jobs job is to send some emails to some users.
The problem is, when I try to load a Stack into the job:
Calling
$text = Stack::getByName('mitgliedschaft_laeuft_bald_ab')
$myhtmlString = $text->display()
Call to a member function getAreaCustomStyle() on a non-object
Edit:
I give the block in the stack a block name (handle)
under Admin -> Blocks & Stacks -> Edit Modus (on a block in the stack) -> Advanced
then I call it like so:
$block = Block::getByName('block_name'); $block->display('scrapbook'); // But because the display-method is void I can't do this: $var = $block->display('scrapbook');
I had a look into Page/Area/Block/Collection/... classes, but no luck.
How can I put a Stack's block type "Content" into a variable as string?
As said in the "Edit" Part: Give the Block in the stack a name (handle).
Then call the controlle and get the content: