How to insert data into template blocks from action class?

A place for users and developers of the Xataface to discuss and receive support.

How to insert data into template blocks from action class?

Postby FractalizeR » Mon Oct 24, 2011 1:30 pm

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?
FractalizeR
 
Posts: 19
Joined: Tue Oct 04, 2011 5:26 am

Re: How to insert data into template blocks from action class?

Postby shannah » Mon Oct 24, 2011 1:44 pm

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}
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: How to insert data into template blocks from action class?

Postby FractalizeR » Mon Oct 24, 2011 11:48 pm

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?
FractalizeR
 
Posts: 19
Joined: Tue Oct 04, 2011 5:26 am


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 20 guests

Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved