1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

page node

Discussion in 'XenForo Questions and Support' started by Senpai, Apr 30, 2016.

  1. Senpai

    Senpai Formerly RamzanHD

    hey xF members ,

    you know when i create a page node does it create a templete and if it does please tell me where its located at and if theres no templete can you guys help me to create one
  2. Lawrence

    Lawrence Well-Known Member

    When you create a new page node, a template is created named _page_node.x, where x is the node id. This template is used for HTML you may have placed in the Page Options->Template HTML text field.

    If you want to display custom data from an add-on, then you need to have a class and method placed in the PHP callback fields that will be executed.

    For example:
    class Icewind_IcewindDale_PageCallback_TrainingHall
        public static function 
    trainingHall(XenForo_ControllerPublic_Abstract $controllerXenForo_ControllerResponse_Abstract $response)
    $visitor XenForo_Visitor::getInstance()->toArray();
            if (
    $charData = array('blah' => 'blah blah''bug' => 'bug bug');
    $response->params['char_data'] = $charData;
    $response->templateName 'icewinddale_training_hall';
    In this example the params is passed to the template named icewinddale_training_hall, that I created to be used.

    If your page node is to be used to interact with members, then you need to create a ControllerPublic class to handle any form data, clicks, etc.
    After the data is saved, it will return a response pointing back to the page nodes route, something like this:

    return $this->responseRedirect(

    or to another template:
    return $this->responseView(
    Senpai likes this.
  3. Senpai

    Senpai Formerly RamzanHD

    thank you soo much you know where do i place css
  4. Lawrence

    Lawrence Well-Known Member

    For Page Options->Template HTML? in with the html, like so:
    <xen:require css="iwd_page_test.css" />
    <div class="hello">hello page</div>

    iwd_page_test.css template I created:
    color: orange;

    The above, for this example will generate hello page.

    If you are using a PHP callback, just include it in your custom template at the top.

Share This Page