Creating my first addon


Well-known member
Hello, I'm trying to learn my way around xenforo and create my first add-on. So I choose to create a simple photo contest. Probably not a good idea for a first add-on, but hey, must as well give it a try!

So I started to take the page call back function approach(

I created some folders inside the xenforo library: GLPC/PageCallback with an index.php file containing the following code:

class GLPC_PageCallback_index
    public static function respond(XenForo_ControllerPublic_Abstract $controller, XenForo_ControllerResponse_Abstract $response)
        $response->templateName = 'GLPhotoContest';
I then created the page with and call back to GLPC_PageCallback_index and method of respond.

After I created the template GLPhotoContest:

    <xen:breadcrumb source="$nodeBreadCrumbs" />

<link rel="xenforo_stylesheet" type="text/css" href="glpc.css" />

<div class="sectionMain">
    <h2 class="subHeading">Welcome to our photo contest page.</h2>
    <p>This is where the photo contest entries will appear/my data base entries pull page</p>
    <p>Ideas: Use the like system for voting/allow only one like per entry</p>
    <div class="sectionFooter"># of Entries</div>
But now, I want to know how to create the entry page, where user will submit the entries! Basically the page is going to call for a template where a form will pop-up for the user to enter the title, description, and be able to upload.

Can someone steer me to the right direction. I remember seeing a post that kier put up on how to pull up and pop-up overlay with custom template, but can't find it.

You help is appreciated!