How to insert data into template blocks from action class?
Posted:
Mon Oct 24, 2011 1:30 pm
by FractalizeR
I have a class
- Code: Select all
class actions_my_action {}
in
- Code: Select all
actions/my_action.php
file which renders templates via df_display(). How do I correctly insert data into template blocks? Is that possible? If not, what's the workaround?
Re: How to insert data into template blocks from action class?
Posted:
Mon Oct 24, 2011 1:44 pm
by shannah
You do that via the template itself. Generally you extend from the Dataface_Main_Template.html template, and then fill one of the slots (usually main_section or main_column)
e.g.
- Code: Select all
{use_macro file="Dataface_Main_Template.html"}
{fill_slot name="main_section"}
My content
{/fill_slot}
{/use_macro}
Re: How to insert data into template blocks from action class?
Posted:
Mon Oct 24, 2011 11:48 pm
by FractalizeR
I understand, but slots and blocks are different entities, right? When I override slot, I replace it's contents. But when I use block, I add something into template, not replacing original contents. I'm using slots already. I'm just curious, can I use blocks too from action?