XF 1.0 Editing Templates and Defining a Callback for Pages

Jerry

Well-known member
/me terminals in KDE ......

Code:
kate webdav://quartz/cbi/dev/admindav.php/Admin_Templates/color_picker.html
Yup working fine.
 

EQnoble

Well-known member
I have a question in regards to debug mode.. I tried to use the if condition with my ip in the config.php and it shows nothing. Debug mode works for me just not with that in config. Some help?

Edit:
Figured it out, there was a rogue character floating around the config file...
disregard this. :)
 

we_are_borg

Well-known member
Really nice that WebDav is present in Xenforo can't wait till i get Webdav working on my Linux system would be great when editing templates.

Kier on a side note i see that you some times make example js files and php files in your tutorials can you please include the finished files in a zip so that we do not have to start from 0%.
 

Digital Doctor

Well-known member
It is currently not possible to edit a Page outside the ACP.
That's too bad. Major Limitation.

As much as the videos show how to create PHP callback pages .... a demo on xenforo.com would cement the idea for many more users.
This needs a demo !
 

Kier

XenForo developer
Staff member
The HTML for Pages is stored as templates, so you can edit them in your favourite editor using WebDAV like any other template.

They are stored as _page_node_{node_id}
 

Veer

Well-known member
The HTML for Pages is stored as templates, so you can edit them in your favourite editor using WebDAV like any other template.

They are stored as _page_node_{node_id}
So can we edit/update page templates directly from templates? no need to go on nodes area?
 

we_are_borg

Well-known member
Well got WebDav working with Dreamweaver can now edit the templates just like in the video. I must say that this is a very nice feature.

The only thing i need now is to highlight the XenForo syntax in Dreamweaver, or if you can provide that Kier i would be so great full.
 

CroNiX

Active member
OK, I purchased XF and am trying to follow these tutorials but there is no "development" tab in my xf admincp? Where/how do you activate that? Sorry...been searching and can't find it.
 
R

ragtek

Guest
You have to enable the debug modus.

Add in your config.php
PHP:
$config['debug'] = true;
 

masterchief

Well-known member
I tried following along with video, everything eventually falling into place.
I am getting error when I include the sidebar_online_users template.
Please advise.

TemplateDemo.php
Code:
<?php

class Dev_PageCallback_TemplateDemo
{
    public static function respond(Xenforo_ControllerPublic_Abstract $controller, Xenforo_ControllerResponse_Abstract $response)
    {
        // fetch recent registration
        $userModel = $controller->getModelFromCache('Xenforo_Model_User');
        $response->params['users'] = $userModel->getLatestUsers(array(), array('limit'=> 5));

        $response->templateName = 'template_demo';
    }
}
?>

TemplateDemo template
Code:
<xen:title>{$page.title}</xen:title>
<xen:navigation>
    <xen:breadcrumb source="$nodeBreadCrumbs" />
</xen:navigation>
<xen:require css="template_demo.css" />
<div class="sectionMain">
    <h2 class="subHeading">Most Recent Registrations</h2>
    <ol>
        <xen:foreach loop="$users" value="$user">
            <li class="secondaryContent userThing">
                <xen:avatar user="$user" size="s" />
                <a href="{xen:link members, $user}" class="username">{$user.username}</a>
                <div class="userTitle">{xen:helper usertitle,$user}</div>
                <xen:datetime time="$user.register_date" />
            </li>
        </xen:foreach>
    </ol>
    <div class="sectionFooter">Showing {xen:count $users} users.</div>
</div>

<xen:sidebar>
    <xen:include template="sidebar_online_users" />
</xen:sidebar>
 

masterchief

Well-known member
This is test site on localhost with screengrab of the error .. also notice that sidebar indicated no users online. As I have switched my user acct to show online status there should be one user online. NOTE: There are no indicated errors until after sidebar is added to the template. regards

template_demo_error_msg.png
 
Top