- This topic has 3 replies, 3 voices, and was last updated 4 years, 10 months ago by
kiwi.
-
13th April 2018 at 2:52 am #10228
Hi all,
I want to add GMT Timezone info in the BIRT fact regarding to the PLAC of birth, exactly like you can add a Temple (TEMP) while adding a new “SDJ: confirmation event” (CONL) for exFor that, I have looked (and duplicated) the TEMP
- In function_edit.php page, i’ve added a line :
echo select_edit_control($element_name, KT_Gedcom_Code_Gmt::GMTFuseauxNames(), KT_I18N::translate(‘Fuseau Horaire’), $value);
- In \library\KT\Gedcom\Code I’ve created a Gmt.php page with functions and arrays (from Temp.php) duplicated.
It’s a dropdown menu with some data like +1 / +2 / +3 ….
It works well (my data are shown in the select) if I call KT_Gedcom_Code_Gmt::GMTFuseauxNames() instead of KT_Gedcom_Code_Temp::templeNames() in the function_edit.php page for example
But how can I add a complete line when a BIRT event is added (or updated) displaying my KT_Gedcom_Code_Gmt::GMTFuseauxNames() function below the “birth place” area field ?
I can’t find the loop that displays the infos in order to call my “function” inside the
I think it should be simple, but …. not form me !
Thanks if you can help !----- [updated: 31Dec2022] MacOS: 10.15.7 (Catalina) Safari 14.1.2; Firefox 108.0.1 (64-bit); 108.0.1462.54 (Official build) (x86_64)
Alter-Drukarsh connections | The Garelick: 3.3.11b - PHP 8.0 FastCGI - mySQL 8.
-
13th April 2018 at 9:54 am #10230
There is possibly a lot to add. But the loop you are looking for is the code in functions_edit.php following this comment (about line 2436)
// List of tags we would expect at the next level // NB insert_missing_subtags() already takes care of the simple cases // where a level 1 tag is missing a level 2 tag. Here we only need to // handle the more complicated cases.
Further down (about line 2528) you will see a reference to KT_Gedcom_Code_Temp::isTagLDS($level1type). You will need similar code for your changes.
But you will also need to make additions to the file /includes/config_data.php
(Note – I can’t test what you are doing so can not say if this is everything. You may well need much more. The following tip should help though.)
Tip:
Use a quality text editor that has the ability to search globally, through the entire kiwitrees code. Then you can take a function like “isTagLDS”, or a specific tag like “SLDC” and find all it’s use locations quickly and easily. Then you know what you need to do for your new code. I recommend either “atom” (https://atom.io/) or “sublime” (https://www.sublimetext.com/). I use both.I probably do not need to remind you of this, but just in case:
Remember that all changes to the core code will need to be done over again after every kiwitrees upgrade, as that will over-write the standard files. That means repeating your changes somewhere between 5 and 8 times each year.Nigel
My personal kiwitrees site is www.our-families.info -
14th August 2018 at 1:34 am #10336
Hi Nigel,
I tried to add the field but … it’s a bit complex…. so I prefer renounceBut if I want to add an existing field to an event, such as “URL” to the Birth event (in order to add a url that present the picture of the baby), how can I do easily ?
Do I just have to add in the config_data.php php the “BIRT” field in the “URL” Array like that ?
‘URL’ => array(
‘OCCU’,
‘RESI’,
‘BIRT’,
),Or is there an other config file ?
Thanks for your help -
14th August 2018 at 7:04 am #10337
But if I want to add an existing field to an event, such as “URL” to the Birth event (in order to add a url that present the picture of the baby), how can I do easily ?
Do I just have to add in the config_data.php php the “BIRT” field in the “URL” Array like that ?
‘URL’ => array(
‘OCCU’,
‘RESI’,
‘BIRT’,
),
Or is there an other config file ?
Thanks for your help
It’s really neither necessary or recommended to do this.
Not recommended because URL is not a valid GEDCOM tag for any event such as BIRT.
Not necessary because you can add a url in place of a media object. Just follow the normal process for adding a media object to the event, but add the URL instead (this will make more sense when you see the “Add media” screen). The image will be displayed like any normal media object but using the external url instead of the internal link. The only minor issue is that in such cases nor ‘thumbnail’ version can be created.Nigel
My personal kiwitrees site is www.our-families.info
- The topic ‘Adding new KT_Gedcom_Code in new BIRT Fact’ is closed to new replies.