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

What is the best way to add extra fields to forums?

Discussion in 'XenForo Development Discussions' started by Razasharp, Oct 5, 2013.

  1. Razasharp

    Razasharp Well-Known Member

    What are your thoughts on the best way to add extra fields to forum sections (/nodes)? They will contain a short string. And could you call these values in templates easily - perhaps with something like; node.my_field ?

    Also, is it really hacky to simply create and set new columns in the DB directly via mysql prompt?
     
  2. Marcus

    Marcus Well-Known Member

    The most easy thing is to add one field while not using node descriptions. In that case you just use the description field as your custom field.

    Then you also could add a row on xf_node.

    Or, better (and more difficult): create your own table and join it with the general node table.

    Even better would be to only do this for special node_types (so only forums, not forum links).
     
  3. Razasharp

    Razasharp Well-Known Member

    Thanks Marcus. I think we'll need to keep the node descriptions tho. I know it's hacky but I might just add them to the table - I just need to make sure I can call them easily with something like node.my_field
     

Share This Page