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

Adding Option to Nodes

Discussion in 'XenForo Development Discussions' started by Ghan_04, Feb 4, 2012.

  1. Ghan_04

    Ghan_04 Active Member

    I'd like to add a toggle option to the nodes table for use in templates in the style. The best thing would be if this appeared as a checkbox in the Admin CP options for each node. The problem is, I have no idea how to do that. It looks like some kind of template modification for the Admin Templates, but I've seen other add-ons add their own templates for stuff like this.
    I've been looking around the forums to no avail. Is there a guide on how to do this? It should not be too difficult.
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Adding the form fields is just one step. You can use template hooks to add the fields to the page. Then you need to extend the admin controllers to process the fields, and extend or create your own datawriter to save the fields. This addon is a good example to follow as it does all of this:

    http://xenforo.com/community/resources/nodes-as-tabs.9/
     
  3. Ghan_04

    Ghan_04 Active Member

    Hehe. We actually use that addon. Problem is, I could not figure out how it worked. o_O
     
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    The best place to start is with the listeners:

    Admin CP -> Development -> Code Event Listeners

    They all point to functions in the Listen.php file.
     

Share This Page