uhanke Posted February 15, 2023 Report Share Posted February 15, 2023 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. Quote Link to comment Share on other sites More sharing options...
Bill Herndon Posted February 15, 2023 Report Share Posted February 15, 2023 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 Quote Link to comment Share on other sites More sharing options...
uhanke Posted February 15, 2023 Author Report Share Posted February 15, 2023 Thank you Bill. I will do that tomorrow. It is midnight here in Germany. Uli Quote Link to comment Share on other sites More sharing options...
uhanke Posted February 16, 2023 Author Report Share Posted February 16, 2023 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 Quote Link to comment Share on other sites More sharing options...
Bill Herndon Posted February 17, 2023 Report Share Posted February 17, 2023 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 Quote Link to comment Share on other sites More sharing options...
Ken Roy Posted February 17, 2023 Report Share Posted February 17, 2023 Uli you may want to take a look at Creating a new template - TNG v12 on what is needed to allow you to update the fields using the Template Settings in a multi-language environment Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.