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

Multiple Textbox Admin Template

Discussion in 'XenForo Development Discussions' started by Tom Christian, Jan 4, 2015.

  1. Tom Christian

    Tom Christian Active Member

    I want to create a custom admin template that's based upon the below option found in XenGallery by @Chris D

    [​IMG]

    I need to add some additional fields to each section but I'm having trouble working out how to properly save the values and then display them. What I need is something like:

    [​IMG]

    1. I've created a new admin template and added an additional field. (Just testing by adding 1 new field to begin with...) - Here.

    2. I've setup a new option with a PHP Callback + Verification callback exactly how XenGallery does it. Here's the class. What do I change in the class to achieve this? I noticed that the array format is slightly different to what I need...IIRC - XenGallery has something like

    array('facebook' => 'url1', 'dailymotion' => 'url2')

    But I think I need something like:

    array(
    array('field1'=>'val1','field2'=>'val2','field3'=>'val3'),
    array('field1'=>'val1','field2'=>'val2','field3'=>'val3'),
    array('field1'=>'val1','field2'=>'val2','field3'=>'val3')
    )


    Any help is much appreciated. Feel free to edit my gists.

    Thanks,
    Tom.
     
    Last edited: Jan 4, 2015
  2. Tom Christian

    Tom Christian Active Member

    Anyone tried anything like this before? I'd love to get this working.
     
  3. Chris D

    Chris D XenForo Developer Staff Member

    It should be do-able.

    In the XFMG code you're using as an example, you should use the verifyOption method to format the input from the form how you'd like it (if necessary) before it is saved to the database and then furthermore, use the renderOption method to format it for how it should be displayed in the template.

    It shouldn't be too different from the code that's already there.
     

Share This Page