Just enter the page name in that field, e.g. myfirstpage, test, mypage, team, etc.
Did you ever get this working? After Brogan's post it sounded like it was possible. Or do we need to use the PHP Callback functionality.Okay I have done that and its allowed me to save but when I use php within the template it isnt working, or at least it appears it isnt.
All I am using is this:
Code:<div class="baseHtml messageText"> <?php require("/home/xxx/public_html/myfile.php"); ?> </div>
Any ideas on how to get it to work?
Redownload XenForo dustribution and reupload the files. It was a bug fixed in first few hours.
As you might expect that will not work.Okay I have done that and its allowed me to save but when I use php within the template it isnt working, or at least it appears it isnt.
All I am using is this:
Code:<div class="baseHtml messageText"> <?php require("/home/xxx/public_html/myfile.php"); ?> </div>
Any ideas on how to get it to work?
<div class="baseHtml messageText">
{xen:raw $myContent}
</div>
<?php
class XenForo_Pages_Test
{
public static function includeFile(XenForo_ControllerPublic_Abstract $controller, XenForo_ControllerResponse_Abstract &$response)
{
ob_start();
require('/path/to/your/html/file.html');
$myContent = ob_get_contents();
ob_end_clean();
$params = array(
'myContent' => $myContent
);
$response->params = array_merge(
$response->params,
$params
);
}
}
As you might expect that will not work.
Ok, into the the Template HTML-field you write:
HTML:<div class="baseHtml messageText"> {xen:raw $myContent} </div>
You have to set a PHP callback class and method
class-name: XenForo_Pages_Test
method-name: includeFile
When naming the class you should keep the xenforo folder structure in mind.
Now you have to create a php-file <xenforo>/library/XenForo/Pages/Test.php. The sub-folder Pages does not exists by default, so you have to create it first. The file/path and the clase-name must match or you will end up in an error.
The php-file content:
That example is quite simple, you can easily assign more variables to the $params-array or include php-files with even more vars. :-DPHP:class XenForo_Pages_Test { public static function includeFile(XenForo_ControllerPublic_Abstract $controller, XenForo_ControllerResponse_Abstract &$response) { ob_start(); require('/path/to/your/html/file.html'); $myContent = ob_get_contents(); ob_end_clean(); $params = array( 'myContent' => $myContent ); $response->params = array_merge( $response->params, $params ); } }
You then might want to add a ?> at the end of your posting, too.And dont forget the <?php at the beginning of the file. I will add that in my post, too.
You then might want to add a ?> at the end of your posting, too.
Anyway, great posting.
Yes the class and method have to exist. It's the same as with the Code Event ListenersThanks, its now working wonderfully I had to create the php file first otherwise it will not save.
GOOD question. I'll be interested in the answer for this as well.I would like to create a page very similar to the default one named "Terms and Rules", saying I would like to create a page for the "Imprint".
I want to have this page in the "Help" section, the same as we have for "Terms and Rules".
domain.com/help/imprint
How do I get my "imprint page" into the Footer of the website, just next to the link of "Terms and Rules" ?
Many thanks,
You need to edit the footer template and add your page url to it.How do I get my "imprint page" into the Footer of the website, just next to the link of "Terms and Rules" ?
Many thanks,
<div class="footerLegal">
<div class="pageWidth">
<div class="pageContent">
<div id="copyright">{xen:phrase xenforo_copyright}</div>
<ul id="legal">
<xen:if is="{$tosUrl}"><li><a href="{$tosUrl}">{xen:phrase terms_and_rules}</a></li></xen:if>
<xen:if is="{$xenOptions.privacyPolicyUrl}"><li><a href="{$xenOptions.privacyPolicyUrl}">{xen:phrase privacy_policy}</a></li></xen:if>
</ul>
</div>
</div>
</div>
We use essential cookies to make this site work, and optional cookies to enhance your experience.