This topic is locked

Including HTML on View Pages from other sources

8/30/2007 11:09:59 AM
PHPRunner General questions
S
Skydoc author

Hi!
Please forgive me if this is simple and I have missed something. I am currently evaluating this software and I have to say it is incredbily powerful. have one specific requirement however. I need to insert a block of html into the view page that comes from a static file on the server. Ideally I would like to store the file name as a data filed on the mysql server so that as the php is parsed the script gets the file as defined in the selected record and places the html in that file into the page body (rather than just a link to that file).
This is because I have a large number of html pages that need to be displayed as part of each individual record in the database. Of course I could just render the pages as RTF by cutting and pasting the content into an appropriate field and storing the whole thing in the mysql database, but the html pages change regularly, and the best way would be to have them included in the final output.
I have tried simply using
<?php include("menu.php"); ?>
but if I call this after $smarty->display("countryhealth_view.htm");
I get the unformatted page included after the nicely formatted Smarty content.
So, in short guess that my question is if there is some way I can use Smarty to get the file and include it in the output when the page finally calls $smarty->display("countryhealth_view.htm");
In addition I was hoping I could use a field in an individual database record to specify the htm / html page that was included and displayed in this way.
Lastly, [gulp] - is there any way this could be done if the file to be included was an asp page? - I get a php error from the headers if I simply use <?php include("menu.php"); ?>
Thanks in advance for your help - Im sure there is a simple way of doing this!
Kind Regards
Geoff.

Sergey Kornilov admin 9/1/2007

Use the following in Visual Editor (HTML mode)

{include_if_exists file="menu.php"}