PDA

View Full Version : PHP Question


Feydakin
09-03-2005, 01:12 AM
Ok, this is confusing me, as usual - I'm getting too old to learn another language - anyway, I have put my new menu in a file called menu.main in the templates directory

Content visible to registered users only.

Works fine..

But, I want to call it from the root so I can share that menu everywhere and make it wasy enough to find.. Like this..

Content visible to registered users only.

Adding the preceeding slash makes it not work at all.. Throws out a 'smarty error'.. Warning: Smarty error: unable to read resource: "/menu.main" So, off to adding a simple php tag

Content visible to registered users only.

No error, just a blank.. Anyway, I'm still reading docs, but if anyone has a better clue than me, I'd appreciate a pointer..

Steve

kickass
09-04-2005, 04:19 PM
Did you try {include file="../menu.main"}

or

{include file="http://myabsoluteurl.com/menu.main"}

???

Feydakin
09-05-2005, 04:44 AM
Yup, tried all those.. It seems like anything above the directory folder makes smarty unhappy.. It really doesn't see right that it would.. I suppose that it'll just have to be a duplicate file in the templates directory..

Its not terrible, just not elegant..

Ap0s7le
09-05-2005, 05:17 AM
That's because include pulls the file from the templates folder.

Try
Content visible to registered users only.

later