{include} tag

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
olavt

{include} tag

Post 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?
cyberman

Re: {include} tag

Post by cyberman »

Is this the ful file path from root directory?
olavt wrote: "guitar/inc-filer/Rhythm.inc.php""
olavt

Re: {include} tag

Post 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.
cyberman

Re: {include} tag

Post 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.
olavt

Re: {include} tag

Post 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.
cyberman

Re: {include} tag

Post by cyberman »

Please make a look at smarty docu - the "root" for include tag is template dir so you have to modify path.
Locked

Return to “CMSMS Core”