ZenphotoCMS Forum
How to use include(); in codeblock ? - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: How to use include(); in codeblock ? (/thread-9829.html)



How to use include(); in codeblock ? - ferentz - 2012-04-07

Hello! I'm trying to use the include(); function in the page codeblock, but I'm getting a php error "failed to open stream: No such file or directory". The same code works fine if I type it directly in pages.php. Is there something I'm missing? Thanks!

``

I could use an if statement in pages.php to print the included code only in my desired page, but I think that's nasty coding.




How to use include(); in codeblock ? - ferentz - 2012-04-07

p.s. Is there a similar variable for uploaded folder?
``




How to use include(); in codeblock ? - acrylian - 2012-04-07

If you want a specific page layouted specifially you should look at the multiple_layouts plugin. (I don't think using an if statement would be nasty coding, I do that all the time on our own site but that is partly from times before said plugin existed).




How to use include(); in codeblock ? - sbillard - 2012-04-07

You will probably have to use the fully qualified path to the script. Includes like you show are relative to the "current" folder. For codeblocks it is problematical to know what the current folder might be.

There are defines for the various Zenphoto folders. See golbal-definitions.php.