LaCollision Posted February 5, 2015 Share Posted February 5, 2015 Hi there,With IPS 3.x, I was used to parse PHP files in templates, like that:{parse include="../path/to/my/file.php"}Is there a way to achieve the same with IPS4?Thanks a lot, Link to comment Share on other sites More sharing options...
Andy Millne Posted February 5, 2015 Share Posted February 5, 2015 {{ include('...'); }} Link to comment Share on other sites More sharing options...
LaCollision Posted February 5, 2015 Author Share Posted February 5, 2015 {{ include('...'); }}Hi,Thanks, that's what I did, but as it is part of an IPS template, I get the famous error "Cannot modify header information - headers already sent by…"Any idea?Thanks again, Link to comment Share on other sites More sharing options...
Andy Millne Posted February 5, 2015 Share Posted February 5, 2015 Perhaps if you explain what the end goal is it might be easier to advise. It's possible what you are trying to do is better suited to a theme hook Link to comment Share on other sites More sharing options...
LaCollision Posted February 5, 2015 Author Share Posted February 5, 2015 Perhaps if you explain what the end goal is it might be easier to advise. It's possible what you are trying to do is better suited to a theme hookThanks a lot Andy for your help.My needs are very basic: my Invision installation is part of a "regular" website. I just want to include in the globalTemplate some PHP files, that display parts of my website (for instance a "latest news" block somewhere in the template).With the IPB 3.x {parse include="…"} instruction, I was able to do it very simply, without going too deep in the IP.Board configuration (creating a hook…).Do you think it is possible with IPS 4 ?Thanks again, Link to comment Share on other sites More sharing options...
LaCollision Posted February 5, 2015 Author Share Posted February 5, 2015 Perhaps if you explain what the end goal is it might be easier to advise. It's possible what you are trying to do is better suited to a theme hook I did something like that: {{include('../path/file.php');}} {$renderedPHP|raw} With the file.php using a buffer system: $renderedPHP = ""; ob_start(); include('the-file-i-want-to-include.php'); $renderedPHP = ob_get_contents(); ob_end_clean(); … but it's not very clean, is it? Link to comment Share on other sites More sharing options...
Andy Millne Posted February 5, 2015 Share Posted February 5, 2015 I guess we could add a similar template plugin to do this in 4.x. I'll raise it for discussion as there may be a good reason it was not included. Link to comment Share on other sites More sharing options...
LaCollision Posted February 5, 2015 Author Share Posted February 5, 2015 I guess we could add a similar template plugin to do this in 4.x. I'll raise it for discussion as there may be a good reason it was not included.Thanks a lot, that would be amazing. Link to comment Share on other sites More sharing options...
Andy Millne Posted February 5, 2015 Share Posted February 5, 2015 The syntax for this in the next release will be{insert="yourfile"}include caused a naming conflict Link to comment Share on other sites More sharing options...
LaCollision Posted February 5, 2015 Author Share Posted February 5, 2015 The syntax for this in the next release will be {insert="yourfile"} include caused a naming conflict I love you Link to comment Share on other sites More sharing options...
TSP Posted February 5, 2015 Share Posted February 5, 2015 Thanks Andy, we've also been using the same to include some simple html files that are generated to the shared file system from another system to incorporate some articles. It's good it's a quick and easy thing to do Link to comment Share on other sites More sharing options...
LaCollision Posted February 5, 2015 Author Share Posted February 5, 2015 The syntax for this in the next release will be {insert="yourfile"} include caused a naming conflict Is it included in Beta 7? Link to comment Share on other sites More sharing options...
ipbfuck Posted December 15, 2015 Share Posted December 15, 2015 Hi, i've try this directly in template, but not work for me... someone can try to best explain, please? :/ - edit: Ok, sorry, in first moment i've try with full server path and this not work. After of this i've try with path from ipb root, and work fine Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.