![]() |
How to include HTML file
In 3.x version, I can add a plugin. $test=implode (file, dir).
Then add $test in a template. How to do this in 4.x version? |
You can pre-register the variable in the template where you will use it, like this:
Code:
vB_Template::preRegister('template_name', array('test' => $test)); and then of course you'd use one of HTML Code:
{vb:raw test} or |
I pre-registered:
Code:
$include_defaultpage = implode('', file('/bbs/CCED/float/default.html')); I put {vb:raw include_defaultpage} into the footer template. However, it does not work. |
I tried what you posted above, except that I just used $include_defaultpage = "Foo"; as a test, and it showed up in my footer. Are you sure you're looking at the style with the edited footer? Otherwise, maybe it's not finding your html file?
Edit: also, are you sure you set the plugin to active? I've been known to forget that occasionally. |
I also tried $include_defaultpage = "Foo";, It still does not show up.
--------------- Added [DATE]1309229656[/DATE] at [TIME]1309229656[/TIME] --------------- Here is how I write: Code:
|
'footer' needs to be lower case. You had it that way before so I guess you probably were trying things.
|
I just did a test. If I put this plugin in header template. It works.
vB_Template::preRegister('header',array('include_d efaultpage' => $include_defaultpage)); --------------- Added [DATE]1309230334[/DATE] at [TIME]1309230334[/TIME] --------------- it works now. I changed /bbs/CCED/float/default.html to CCED/float/default.html You are right. It did not find the file. Thanks. |
All times are GMT. The time now is 03:55 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|