Jump to content

Include external files


JLS

Recommended Posts

I've found several old IP4 topics that were in the beta, feedback, and bug report (closed) areas. I'm not sure if any of them in those areas seemed appropriate to comment in still so I'm making a new topic.

I need to include an external file in our template like I did in IP3. From what I can gather the code is

{{insert='/home/username/public_html/domain/external-file.txt'}}

But that's not working. Any ideas? I read one comment that might indicate the file has to be in the IP installations folder rather then in another location on our site but nobody confirmed. I hope that's not the case.

Thanks!

Link to comment
Share on other sites

20 hours ago, Morrigan said:

Have you tried the proper PHP wrapped in the double braces?


{{include '/home/username/public_html/domain/external-file.txt';}}

That may work?

I've tried this and just tried it again. Produces a "Safari Can't Open Page - Can't decode raw data error NSURLErrorDomain:-1015". But safari never had a problem with the old code in 3.4 and same file which was:

{parse include="/home/username/public_html/domain/external-file.txt"}

 

20 hours ago, Marcher Technologies said:

It's a template plugin, single braces, not double:


{insert='/home/username/public_html/domain/external-file.txt'}

 

I've tried that too but just tried again. Error 500 :(

Link to comment
Share on other sites

Can anyone confirm they got one of these codes to work on their own site? Debating if I should submit a new bug for it since there was one in the past and it was debated whether it was fixed or not I believe...

Thanks

Link to comment
Share on other sites

1 hour ago, JLS said:

Can anyone confirm they got one of these codes to work on their own site? Debating if I should submit a new bug for it since there was one in the past and it was debated whether it was fixed or not I believe...

Thanks

This works for me.

{insert="mydocs/somefolder/somefile.php"}

I'm on 4.1.0 though.

Probably the insert command doesn't work with .txt files.

Link to comment
Share on other sites

Ok thanks! I'm using 4.1.0 as well.

I did get that code to work (and with .txt) so that's cool. BUT, it's only working if the file is inside the forum folders and not another location on the site. I can probably make this work but that's an odd restriction. Especially if it's only happening to me?...LOL.

Link to comment
Share on other sites

Archived

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...