Roger Posted November 6, 2009 Share Posted November 6, 2009 (edited) I trying to do something that I think should be reasonably simple. Trying to display a tpl file from within another tpl file. according to the Smarty site this should do the trick: {include file='file:templates/template_name/file.tpl'} But nothing displays. I have resorted to using a test file whose contents are "Hello World!" only. Still nothing. Is there some mystery surrounding the Smarty {include} thingie that I don't know about?? Thanks -Roger Edited November 6, 2009 by Roger 0 Quote Link to comment Share on other sites More sharing options...
freedombi Posted November 6, 2009 Share Posted November 6, 2009 Try it without the 'file:' as part of the filename, eg: {include file='templates/template_name/file.tpl'} 0 Quote Link to comment Share on other sites More sharing options...
Roger Posted November 6, 2009 Author Share Posted November 6, 2009 Thanks for the response. I have tried it that way. Same results. Smarty says either way is good. -Roger 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted November 6, 2009 Share Posted November 6, 2009 Hi Roger Within the template it should be relative to the template directory and not the whmcs root. Try this {include file="$template/file.tpl"} 0 Quote Link to comment Share on other sites More sharing options...
Roger Posted November 7, 2009 Author Share Posted November 7, 2009 Hey Sparky... actually I had {include file="templates/$template/file.tpl"} and was using it from a header.tpl file. As I messed with this I actually saw the path printed to the screen with the variable expanded to the correct template directory name. It's probably something simple I've over looked. It's not overly important but was very annoying that I couldn't get it right. 0 Quote Link to comment Share on other sites More sharing options...
Roger Posted November 7, 2009 Author Share Posted November 7, 2009 Got it finally... it's $template not $templates .... $template/file.tpl not templates/$template/file.tpl Well what can you expect from a guy my age .... heheheh Thanks Sparky.. 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted November 7, 2009 Share Posted November 7, 2009 Got it finally... it's $template not $templates .... $template/file.tpl not templates/$template/file.tpl Well what can you expect from a guy my age .... heheheh Thanks Sparky.. No problem.... glad a fellow oldie could 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.