XF 1.0 Editing Templates and Defining a Callback for Pages

Kier

XenForo developer
Staff member
When we debuted the Pages feature, it was intended to be a simple way to get some custom HTML onto a page surrounded by the standard XenForo user interface chrome. By the time we reached Beta 1, it had evolved into an altogether more powerful system.

Pages now support a PHP callback, so your pages can request data from the database and be used as a platform for building any kind of single-page application you might want to build. They also allow you to override the default and specify your own template to be rendered by the page, so the possibilities really are limitless.

This two-part video shows you the basics of building a simple application using the Pages system, and delves into the realms of the template editor to create and edit the custom HTML that will be used to display your page.


Having built a basic dynamic page, in this second part we add more functionality and data to the page including a sidebar and a list of the authors of the most recent posts. In doing so, we look into advanced template syntax use, and reveal one of XenForo's hidden treasures.


Part 3
I've just uploaded a third part, answering some questions that have come up:


... and created a new answer post here:
http://xenforo.com/community/threads/random-questions-answered.114/page-2#post-102179
 

RickM

Well-known member
Ahh I was wondering why dav was built in :D

Thats a pretty slick templating system you've built there guys!
 

Jeremy

Well-known member
The first video was very informative. Once I get time to watch the second, no doubt I will!
 

Jeremy

Well-known member
All the really juicy bits are in the second video :)
I've noticed and all I got to say is... You and Mike are my hero! I literally just got super excited because Panic's Coda supports WebDAV which means I can use it. And I think they are including or attempting to include custom auto-complete definitions so I could in theory add all of XenForo's stuff into it and i'll be in heaven. haha. That has to be by far the coolest feature I have seen yet!
 

Andy Huang

Well-known member
Nice! I think I just got an easy way to make my project easier... Will need to probe this further to see for sure :)
 
R

ragtek

Guest
Random Question:

Could you somehow set this up on you're own set up where this connects to an SVN repository (I know its not easy to do with more than templates...) so you can utilize this to track changes?
This would be great.

It is/was always a big problem, when you were working in an team when data are saved in the database.
There are 2 add-ons for vB, which allow inserting templates from files into the "live develop system", so it is possible to create templates from files (git/svn friendy^^)
 

Adan0s

Member
This is so sick. Propably the first Websoftware which includes such awesome features. :) Congrats to such a well developed software.
 

Andy.N

Well-known member
Can Page be used as wiki system where permission is granted to all registered member to edit the content?
 
Top