datex Posted March 18, 2011 Share Posted March 18, 2011 Hi I have some code I need to include at several pages. Can i somehow include a html or pgp file in the templates file? If yes - how? 0 Quote Link to comment Share on other sites More sharing options...
datex Posted March 18, 2011 Author Share Posted March 18, 2011 I have tried putting this in at the bottom of homepage.tpl without any luck: {include file='filename.tpl'} 0 Quote Link to comment Share on other sites More sharing options...
bear Posted March 18, 2011 Share Posted March 18, 2011 Try this: {php} include('file.php'); {/php} 0 Quote Link to comment Share on other sites More sharing options...
datex Posted March 18, 2011 Author Share Posted March 18, 2011 Try this: {php} include('file.php'); {/php} Strange it seems not work. When looking in the code for the parsed page - there is nothing. 0 Quote Link to comment Share on other sites More sharing options...
bear Posted March 18, 2011 Share Posted March 18, 2011 It works perfectly on mine. '/path/to/file.php' if it's not in the same folder. What's in the php you're trying to include? 0 Quote Link to comment Share on other sites More sharing options...
datex Posted March 18, 2011 Author Share Posted March 18, 2011 It works perfectly on mine. '/path/to/file.php' if it's not in the same folder. What's in the php you're trying to include? <?php <table style="width:75%;margin-left:auto;margin-right:auto;}" summary="Trust Seals"> <tr> <td style="text-align:center;width:50%;"><script type="text/javascript" src="[url]https://seal.verisign.com/getseal?host_name=www.pesnax.eu&size=L&use_flash=YES&use_transparent=YES&lang=en"></script><br[/url] /> <a href="[url]http://www.verisign.com/verisign-trust-seal[/url]" target="_blank" style="color:#000000; text-decoration:none; font:bold 7px verdana,sans-serif; letter-spacing:.5px; text-align:center; margin:0px; padding:0px;">ABOUT TRUST ONLINE</a> </td> <td style="text-align:center;width:50%;"><!-- GeoTrust True Site [tm] Smart Icon tag. Do not edit. --> <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript" SRC="//smarticon.geotrust.com/si.js"></SCRIPT> <!-- end GeoTrust Smart Icon tag --></td> </tr> </table> ?> 0 Quote Link to comment Share on other sites More sharing options...
bear Posted March 18, 2011 Share Posted March 18, 2011 That isn't PHP in that. If you intend to include html and no PHP, lose the start and end PHP tags in the file. Remove <?php and ?> 0 Quote Link to comment Share on other sites More sharing options...
datex Posted March 18, 2011 Author Share Posted March 18, 2011 That isn't PHP in that. If you intend to include html and no PHP, lose the start and end PHP tags in the file. Remove <?php and ?> I have added this after the last line in homepage.tpl: {php} include('seals.html'); {/php} And when uploaded a file called seals.html in the template directory containing this: <table style="width:75%;margin-left:auto;margin-right:auto;}" summary="Trust Seals"> <tr> <td style="text-align:center;width:50%;"><script type="text/javascript" src="[url]https://seal.verisign.com/getseal?host_name=www.pesnax.eu&size=L&use_flash=YES&use_transparent=YES&lang=en"></script><br[/url] /> <a href="[url]http://www.verisign.com/verisign-trust-seal[/url]" target="_blank" style="color:#000000; text-decoration:none; font:bold 7px verdana,sans-serif; letter-spacing:.5px; text-align:center; margin:0px; padding:0px;">ABOUT TRUST ONLINE</a> </td> <td style="text-align:center;width:50%;"><!-- GeoTrust True Site [tm] Smart Icon tag. Do not edit. --> <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript" SRC="//smarticon.geotrust.com/si.js"></SCRIPT> <!-- end GeoTrust Smart Icon tag --></td> </tr> </table> Nothing is displayed If I write "test text" instead of {php} include('seals.html'); {/php} it is shown at the correct place 0 Quote Link to comment Share on other sites More sharing options...
datex Posted March 18, 2011 Author Share Posted March 18, 2011 That isn't PHP in that. If you intend to include html and no PHP, lose the start and end PHP tags in the file. Remove <?php and ?> I have added this after the last line in homepage.tpl: {php} include('seals.html'); {/php} And when uploaded a file called seals.html in the template directory containing this: <table style="width:75%;margin-left:auto;margin-right:auto;}" summary="Trust Seals"> <tr> <td style="text-align:center;width:50%;"><script type="text/javascript" src="[url]https://seal.verisign.com/getseal?host_name=www.pesnax.eu&size=L&use_flash=YES&use_transparent=YES&lang=en"></script><br[/url] /> <a href="[url]http://www.verisign.com/verisign-trust-seal[/url]" target="_blank" style="color:#000000; text-decoration:none; font:bold 7px verdana,sans-serif; letter-spacing:.5px; text-align:center; margin:0px; padding:0px;">ABOUT TRUST ONLINE</a> </td> <td style="text-align:center;width:50%;"><!-- GeoTrust True Site [tm] Smart Icon tag. Do not edit. --> <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript" SRC="//smarticon.geotrust.com/si.js"></SCRIPT> <!-- end GeoTrust Smart Icon tag --></td> </tr> </table> Nothing is displayed If I write "test text" instead of {php} include('seals.html'); {/php} it is shown at the correct place 0 Quote Link to comment Share on other sites More sharing options...
bear Posted March 18, 2011 Share Posted March 18, 2011 I have added this after the last line in homepage.tpl:{php} include('seals.html'); {/php} And when uploaded a file called seals.html in the template directory You're calling it from the wrong place. The final page is "rooted" in the main WHMCS directory, not the template directory. You would place the file in the same location as the main WHMCS installation to call it as you have here: 'seals.html'. Move that file to the main WHMCS directory, and leave the include call as it is. Does it work? 0 Quote Link to comment Share on other sites More sharing options...
datex Posted March 18, 2011 Author Share Posted March 18, 2011 You're calling it from the wrong place. The final page is "rooted" in the main WHMCS directory, not the template directory. You would place the file in the same location as the main WHMCS installation to call it as you have here: 'seals.html'. Move that file to the main WHMCS directory, and leave the include call as it is. Does it work? yes - thanks so much for your help 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.