Jump to content
TNG Community

Adding fields to Template (additional question) Solved


uhanke

Recommended Posts

I have an own Template which is based on Template 12.

Now i want to make it multilangual - german and english.

For this i need at least 2 more textfields. i checked TNG-Wiki, but didnt find any what can help me. Maybe my english is not good enough or i dont use the right words to search.

Can someone tell me which procedure handles the setup?  - Adding fields, type, size and position for Templatemanager. Also i like to change the naming of fields for Templatemanager, but this is not mandantory.

Link to comment
Share on other sites

If all you need is an additional two text fields, you can add them directly to the _templateconfig.php file for your version Template 12.  The Template Manager mod will insert these into the database when you use the <Load> function for your version of Template 12:

A new template parameter and its German variant would look something like (assuming English is the default):

$tmp['12_mytextfield'] = "fridge";
$tmp['12_mytextfield_German-UTF8'] = "Kühlschrank";

The limitation here is that all parameters not known to TNG are treated as simple text input fields for purposes of display/input in the Admin screen.  There is an array in TNG (I don't remember the variable name) that contains all the 'known' TNG template parameters.  For this reason, I recommend *NOT* changing template parameter names from the base template unless you absolutely have to.  In fact in the templates I've published to the Wiki, I often choose parameters from many templates so that I have a selection names/types known to TNG.

Hope this helps and happy to answer any other questions.

Bill Herndon

Lindell-Herndon Genealogy

 

 

Link to comment
Share on other sites

Thank you Bill. I will do that tomorrow. It is midnight here in Germany.

Uli

 

Link to comment
Share on other sites

Thank you Bill,

Your advice helped me. Now i have what i wanted.

Now one more question. is it easy to change or insert text for the naming? See my red arrows in picture.

Uli

 

Template.jpg

Link to comment
Share on other sites

  • uhanke changed the title to Adding fields to Template (additional question)

Uli... Field labels in administration screens need to have values in the appropriate TNG language files.  It's been a while since I did this for a Mod or template, but i think the array is 'admtext'.  A field label declaration must match the field name you used in the _templateconfig.php file when you loaded the database.  For example, if your field name is identified by 'myinputfield', then the declaration for the German UTF8 language file (languages/German-UTF8/cust_text.php) is:

$admtext['myinputfield'] = "Meine Label ";

My own templates use a Mod just for loading the language strings, but you can do these manually as well.

k/r

Bill

 

Link to comment
Share on other sites

  • uhanke changed the title to Adding fields to Template (additional question) Solved

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...