Include an external template

bart

Active member
Is it possible to include an external template?

Or is there another way to import an template i make with another program? It could reside in the xenforo-directory and would be html.

And yet another step further: can I include a php-script on a page. I would like it to be precessed in category-view with the category-id as a parameter and it would output html to be inserted in the page.
 
i want to add some html i make in a different program. non-xenforo. I would like to be able to read in the file and insert it in - for example - category_view.

I am actually trying to migrate to xenforo and keep using some of my old scripts. I need to find a way to get the output of those scripts inside xenforo.

Do I make sense?
 
I already got that to work because of Kier's video. I was trying to get this include in a forumpage, not in a "page". In category-view. Or forum-view. But it doesn't seem to be possible without an add-on.

Different way to put the question: is there a way to edit a template directly in the database (through phpmyadmin or such) and have the result shown in xenforo instantly?
 
I already got that to work because of Kier's video. I was trying to get this include in a forumpage, not in a "page". In category-view. Or forum-view. But it doesn't seem to be possible without an add-on.

Different way to put the question: is there a way to edit a template directly in the database (through phpmyadmin or such) and have the result shown in xenforo instantly?
You're right. It isn't possible without an add-on.

And no, unfortunately not. There's different stages of templates in XenForo ranging from the basic template syntax all the way through to compiled templates which is the basic template that has been compiled into the raw PHP used to render pages. It certainly wouldn't be advisable to directly edit compiled templates.

Your best bet is to look for a tutorial detailing how to use template hooks. Kier has a video and there's a couple of text based ones in the Resource Manager. This will allow you to use PHP to inject HTML into templates. So you could include your PHP script and render its output directly into an existing template.
 
Thanks for your reply.

I haven't really looked into the hooks-part yet. Guess I'll do that. But I'm a bit weary about that. There are already 76 files read for every page one sees. With only a few add-ons active. I wonder if it will all keep working when ist's showtime.
 
Back
Top Bottom