Saturday, June 7, 2008

Using the df_display() function

You can use the function df_display() to actually include html files (or I think any other file) in your templates folder that can then be displayed in your delegate class functions. For example,


function block__before_header(){
df_display(array(), 'offeringApprovalForm.html');
}


Here we have included the offeringApprovalForm.html file into block at the top or the page. You can then like use javascript to get elements from the form if you need it.

Additionally, the 1st parameter for the df_display() function actually takes an array of variables that can be used in the template as a smarty tag. For example, if we had an array and sent it into the df_display() function


$context = array();
$context['approved'] = 3;
df_display($context, 'left_menu.html');


Then the left_menu.html file can access the approved variable using a smarty tag like this {$approved}. This will display 3 in the location you specified.

No comments: