miniBB ® miniBB®
miniBB Support Forums
 | Forums | Register | Reply | Search | Statistics | Manual |
Re-cycled miniBB Support Forums / Re-cycled /   

how to use '<?php require 'templates/info.html';?> in templates/main_modern_layout.html ?

Author gezgin
Registered
#1 | Posted: 22 Jun 2014 15:46 
I want to embed templates/info.html in templates/main_modern_layout.html

I have put <?php require 'templates/info.html';?> in templates/main_modern_layout.html , on the right column,
but nothing shows up?

how can I solve this?

Author Paul
Lead Developer
#2 | Posted: 22 Jun 2014 16:01 
Direct PHP code won't work in miniBB templates.

You will need to assign some PHP variable with the value and then put it into the table regular way like it happens with all other variables. For example, in your case, you might need to read the contents of the file

$tplInfo=file_get_contents('templates/info.html');

then put {$tplInfo} in templates/main_modern_layout.html.

Author Paul
Lead Developer
#3 | Posted: 22 Jun 2014 16:01 

Author gezgin
Registered
#4 | Posted: 22 Jun 2014 16:44 | Edited by: gezgin 
Okay, I need to put this into templates/main_modern_layout.html:

{$tplInfo}

But where should I put this?? Should I put this into bb_plugins.php:

<?php
$tplInfo = "test";
?>

Author gezgin
Registered
#5 | Posted: 22 Jun 2014 16:50 
it works like charm!!!

Now I can use $tplInfo in all templates in templates folder, am I right?

MiniBB is great!!

Author Paul
Lead Developer
#6 | Posted: 22 Jun 2014 18:27 
gezgin:
Now I can use $tplInfo in all templates in templates folder, am I right?

This approach could be used for any template, any add-on as well.
Thanks, and have success while experimenting :)

Re-cycled miniBB Support Forums / Re-cycled / how to use '<?php require 'templates/info.html';?> in templates/main_modern_layout.html ? Top

Your Reply Click this icon to move up to the quoted message

 Short link for this topic:

 ?
Only registered users are allowed to post here. Please, enter your username/password details upon posting a message, or register first.


Before posting, make sure your message is compliant with our forum posting rules. If not, it may be locked or deleted with no explanation.
 
miniBB Support Forums Powered by Forum Software miniBB ® Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contacts
Install the Captcha add-on: protect your miniBB-forums from the automated spam and flood.
Captcha Addon for miniBB