Page 1 of 1
{include} tag
Posted: Tue Mar 20, 2007 11:29 am
by olavt
I am trying to fing out how to include files. I have tried using {include file="Filename"}. But I always get this type of error message: "Smarty error: unable to read resource: "guitar/inc-filer/Rhythm.inc.php""
How do I include files?
Re: {include} tag
Posted: Tue Mar 20, 2007 11:57 am
by cyberman
Is this the ful file path from root directory?
olavt wrote:
"guitar/inc-filer/Rhythm.inc.php""
Re: {include} tag
Posted: Tue Mar 20, 2007 12:57 pm
by olavt
cyberman wrote:
Is this the ful file path from root directory?
olavt wrote:
"guitar/inc-filer/Rhythm.inc.php""
Yes, from the root guitar/inc-filer/Rhythm.inc.php is the full path.
I have installed CMSMS in the /guitar directory. I have also tried with inc-filer/Rhythm.inc.php (the CMS directory as root), but both give the same error message.
Re: {include} tag
Posted: Tue Mar 20, 2007 1:20 pm
by cyberman
Think, there's something wrong with path. From Smarty doc
{include} tags are used for including other templates in the current template.
Is Rhythm.inc.php a template file?
If not you should try {include_php} instead. But be warned - this tag is deprecated. The easiest will be to use a user defined tag.
Re: {include} tag
Posted: Tue Mar 20, 2007 1:39 pm
by olavt
It is not a template file (to be honest, I am not sure what a template file is). It is an ordinary text file. The path works if I include it in a user defined tag. But I think I will use user defined tags and forget about include problems.
Re: {include} tag
Posted: Tue Mar 20, 2007 2:34 pm
by cyberman
Please make a look at smarty docu - the "root" for include tag is template dir so you have to modify path.