I have been asked to include some html snippet in this php/smarty page. It's basically a sales agreement at the end of an overview page before you pay.
What is the code to include static html into my php/smarty template?
Thanks...
I have been asked to include some html snippet in this php/smarty page. It's basically a sales agreement at the end of an overview page before you pay.
What is the code to include static html into my php/smarty template?
Thanks...
Do you mean include a file containing static HTML?
{include file="htmlfile.html"}
edit
As the file is just HTML, it might be better to use {fetch}
, e.g.
{fetch file="path/to/html/file.html"}
For local files, either a full system file path must be given, or a path relative to the executed php script.
If you are trying to include some code containing javascript or similar, you can use
{literal}{/literal}
tags
to inlude a file you can use {include file="htmlfile.html"}
as Tom said.
Before you display the template, in the PHP file try this:
$smarty->assign('Sectionfile','section-name.html'); $smarty->display('template.tpl');
in the template itself:
{include file="html_dir/$Sectionfile"}
Like any other templates, smarty files are HTML files itself. you can just paste your HTML into smarty template.