Jump to content

Include external file in template

Featured Replies

Posted

In 3.4.7, you could use following template tag to include an external file, such as external header:

{parse include="../somefile.php"}

How is this done in 4.0?

I read this article about Template Tags, but it doesn't mention anything about including files.

In the next beta you'll be able to use {insert="..."} tag :) 

  • Author

Great! :D Thanks for the answer.

PS! Another beta confirmed!! :P 

  • Author

So, has this been added to RC1? :)

I tried using:

{insert="../path/to/file/filename.php"}

But the theme file refuses to save.

Same problem over here! (RC 2) 

The theme editor does not want to save when using {insert="..."}.

{{  include( './my-php-file.php' ); }} works, but when I echo out something I get an error:

Fatal error: Uncaught exception 'ErrorException' with message 'Cannot modify header information - headers already sent by...

 

  • 8 months later...

Just want to let you know that it now works for me in the current version using {insert="..."}.

Nice :)

Archived

This topic is now archived and is closed to further replies.

Recently Browsing 0

  • No registered users viewing this page.