Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted February 5, 201510 yr 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,
February 5, 201510 yr Author {{ 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,
February 5, 201510 yr 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
February 5, 201510 yr Author 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,
February 5, 201510 yr Author 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?
February 5, 201510 yr 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.
February 5, 201510 yr Author 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.
February 5, 201510 yr The syntax for this in the next release will be{insert="yourfile"}include caused a naming conflict
February 5, 201510 yr Author The syntax for this in the next release will be {insert="yourfile"} include caused a naming conflict I love you
February 5, 201510 yr 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
February 5, 201510 yr Author The syntax for this in the next release will be {insert="yourfile"} include caused a naming conflict Is it included in Beta 7?
December 15, 20159 yr 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
Archived
This topic is now archived and is closed to further replies.