How do I insert or call a PHP file in the header?
What is the best way?
I teach step-by-step.
Help me?
How do I insert or call a PHP file in the header?
What is the best way?
I teach step-by-step.
Help me?
|
The best way is to include a php file is to create an injection. There is a database table called sys_injections and there are different locations to inject things found in the template files:
First thing is to determine where you want the injection to show up:
If you look in templates/base/_sub_header.html you will find some of the injection tags that are populated from the "data" field of the sys_injections entries.
Example:
If you wanted something to be added to the "injection_header" tag:
<bx_injection:injection_header/>
You would insert a row into the sys_injections table:
INSERT INTO `sys_injections` (`name`, `page_index`, `key`, `type`, `data`, `replace`, `active`) VALUES ('my_injection', '0', 'injection_header', 'php', 'require_once(BX_DIRECTORY_PATH_ROOT.''myfile.php'');', '0', '1');
Obviously you would have to change the name field, and the path and filename to your file.
Hope this helps...
sup |
It worked perfectly.
Thank you!
|