Question
Customizing GEDCOM
- Mahesh
-
Topic Author
- Offline
- New Member
-
My first post so be gentle with me.
I have been managing a genealogy site for several years but I had absolutely no experience of working with GEDCOM, until now.
I do understand about the pitfalls of customizing GEDCOM tags. BUT for persosonal reasons (ethenicity and alll that!) I would like to,
- add one or two GEDCOM tags
- supress few GEDCOM Tags from appearing in dropdown lists like in Add a fact.
Apologies if this has been asked before.
Thanks in advance.
Mahesh
webtrees-2.1.22
www.upavadi.net/wt-mu/
Please Log in or Create an account to join the conversation.
- Peter_S
-
- Offline
- Senior Member
-
your first requirement is easy to implement. Use a generic event or a generic fact. This is 100% standard-compatible.
To do this, select 'Event' or 'Fact' in the dropdown of the add list and define the type of event/fact in the following step.
Peter
webtrees 2.2.1, vesta modules, chart modules of magicsunday, extended family and imprint of hartenthaler
PHP 8.3.12, MariaDB 10.11.8
Webhosting: genonline.de
Please Log in or Create an account to join the conversation.
- norwegian_sardines
-
- Offline
- Platinum Member
-
- Posts: 2569
- add one or two GEDCOM tags
- supress few GEDCOM Tags from appearing in dropdown lists like in Add a fact.
We would need to know what kind of "tag" you want to add or suppress! The term "tag" is very open, it can be anything from a Fact/Event level 1 tag such as BIRT, DEAT, CENS, etc. or it can be an attribute of a level 1 tag such as DATE, PLAC, CAUS, etc.
So what is it that you want to add or remove?
If you are interested in adding a new fact or event then as @Peter_S suggested you can use the GEDCOM generic FACT or EVEN level 1 tag. For example, I want to add a Military fact:
If you want to remove an attribute of a Level 1 tag then you can look at the GEDCOM tags section of the "Control Panel". You may have to create a module to remove additional Level 1 tags not already supported in the Control Panel.
Ken
Please Log in or Create an account to join the conversation.
- Franz Frese
-
- Offline
- Platinum Member
-
Please be more concrete.
Please Log in or Create an account to join the conversation.
- Mahesh
-
Topic Author
- Offline
- New Member
-
I tring to work out whether webtrees is for me.
I have imported GEDCOM data from my current software . In my import, I have a cusomized tag of the form
Problem I see is when adding / changing a record. It would be great for occassional editors, if the CustomTag was available in the dropdown list.
norwegian_sardines as I only record name, birth,marriage and death in my DB, most of the facts in the dropdown list are not applicable.
Franz Frese , I understand.
Mahesh
webtrees-2.1.22
www.upavadi.net/wt-mu/
Please Log in or Create an account to join the conversation.
- norwegian_sardines
-
- Offline
- Platinum Member
-
- Posts: 2569
A couple of problems however!
1) The v5.5.1 GEDCOM Standard requires that all Fact/Event tags have either a DATE or PLAC level 2 tag to be valid. If you don’t enter this information webtrees may balk at the entry and the GEDCOM may fail to be imported into other programs.
2) Your code example from the imported GEDCOM does not follow any version of the GEDCOM Standard.
A valid GEDCOM custom tag would look like this:
Ken
Please Log in or Create an account to join the conversation.
- drblam
-
- Offline
- Junior Member
-
- Posts: 198
I'm confused, and I think you also. Please take a look at the GEDCOM 5.5.1 specification because the code fragment you supplied is a mash-up of two separate "logical records". Each logical record consists of one or more lines, starting with a line numbered zero and continuing with lines numbered >0, with the restriction that the line number can increase by at most one from the previous line. These numbers are used to create a sequence of nested hierarchy of sub-records, at each level, like nested parentheses in math or begin-end blocks in programming. Thus,I have imported GEDCOM data from my current software . In my import, I have a cusomized tag of the form
Code:1 CustomTag Tag value 1 FAMC @F2@ 1 CHAN 2 DATE 15 May 2012 0 @I5@ INDI
This is displayed correctly and webtrees exports the tag correctly.
- the first line you've shown "
Code:1 CustomTag Tag value
- since you second line "
Code:1 FAMC @F2@
- since the last line you've shown "
Code:0 @I5@ INDI
Please Log in or Create an account to join the conversation.
- fisharebest
-
- Away
- Administrator
-
Here is a module I wrote for someone which adds a number of custom tags. Copy/paste/edit the relevant looking parts.
github.com/fisharebest/amitys-dot-com/bl...module.php#L100-L102
To remove tags is slightly more involved, but uses the same principle. The "INDI" tag is defined in the class "IndividualRecord", and this specifies the allowed subtags. Create your own version of this object (with just the subtags you need) and register it in the same way as in the example module.
Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net
Please Log in or Create an account to join the conversation.
- RickM
-
- Offline
- Junior Member
-
Hello my friend!!
Things have been a bit tough for me of late, however, I am about to help.
And to all of my fellow WebTrees users/devs and very smart folks.. My friend has picked up WebTrees because I brought it to his attention.
I can only answer some of his questions and really would ask that you all help my friend as best you can.
He, me and a few others here have used 'other' software and are now here!!
Mahesh has been a real gentleman friend to me.
Nice to see you here!!
Rick M
Tauranga
Nu Tirani - New Zealand
alineofmalkins.com/wt-malkins
Webtrees v2.2.1
Hosted by HostAmarada on litespeed Server, PHP v8.3
Offline: WebTrees v2.2.2-dev
Laragon v6, PHP v8.3.15
Please Log in or Create an account to join the conversation.
- Mahesh
-
Topic Author
- Offline
- New Member
-
I have Lot to learn about GEDCOM. So far I am only using it as a vehicle to transfer data from A to B. I had just picked the code, arbitrarily, to illustrate my problem. Full code for a person is below. I may have missed / added aline at beginning or end!
The two tags above have been defined in my curent software as Event Tags.
@norwegian_sardines
Ken, Iam not hiding anything. The special Tag refers to ethnicity and I did want our conversation to digress from Q of customized tag.
I have been running my current website, www.upavadi.net/ , for over 15 years . webtrees site is at www.upavadi.net/wt_mu .
Time has come for me to look for a secure website app which has minimal cutomization and can function for reasonably long time so that I can pass the baton to someone else when the time comes.
At the moment, I can pass just over 95% of data using Gedcom and copying media objects. I still have to a lot to learn about Webtrees
@RickM has been very helpful and streetring me the maze, that's Webtrees.
@fisharebest. Greg, I like your idea of making a small change with abit hard coding. The link you shared is not working.
Thanks again for all your help
Mahesh
webtrees-2.1.22
www.upavadi.net/wt-mu/
Please Log in or Create an account to join the conversation.
- norwegian_sardines
-
- Offline
- Platinum Member
-
- Posts: 2569
Ken, Iam not hiding anything. The special Tag refers to ethnicity and I did want our conversation to digress from Q of customized tag.
I have been running my current website, www.upavadi.net/ , for over 15 years . webtrees site is at www.upavadi.net/wt_mu .
Thanks for giving me a hint as to what the “special tag” refers to. If it is an ethnicity based tag, GEDCOM does provide a tag for this purpose, and this is why I asked!
The GEDCOM NATI tag (nationality) is defined to include the national origin, tribe, lineage and other folk divisions. It is potentially possible to use this attribute of an individual to include your information! GEDCOM v7.0 opens up this tag a little more. Based on my understanding of Gotra this would probably work!
In your GEDCOM you marked the CAUS subtag as a “custom tag”, the tag is part of the standard v5.5.1 GEDCOM, therefore you are working toward the right solution.
The CREM fact was deprecated in v5.5.1 GEDCOM and “technically is not allowed now, although webtrees understands this tag as does many other programs!
Ken
Please Log in or Create an account to join the conversation.
- drblam
-
- Offline
- Junior Member
-
- Posts: 198
The first line "2 CAUS Kidney Failure" is absolutely standard GEDCOM. If you click on the edit pen for the DEAT field on an Individual page, the edit form includes a text box labeled "Cause of death", which will create/modify this line.
The second line which you have (partially obscured) as
The lesson here is that you don't have to do any programming to use your custom ethnicity tag as long as (a) the Tag value follows GEDCOM syntax (i.e., "FOO" is ok, but not "CustomTag"), and (b) you don't mind seeing it highlighted in red.
Please Log in or Create an account to join the conversation.
- fisharebest
-
- Away
- Administrator
-
Try again now.
Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net
Please Log in or Create an account to join the conversation.
- Mahesh
-
Topic Author
- Offline
- New Member
-
Mahesh
webtrees-2.1.22
www.upavadi.net/wt-mu/
Please Log in or Create an account to join the conversation.
- RickM
-
- Offline
- Junior Member
-
Rick M
Tauranga
Nu Tirani - New Zealand
alineofmalkins.com/wt-malkins
Webtrees v2.2.1
Hosted by HostAmarada on litespeed Server, PHP v8.3
Offline: WebTrees v2.2.2-dev
Laragon v6, PHP v8.3.15
Please Log in or Create an account to join the conversation.
- Mahesh
-
Topic Author
- Offline
- New Member
-
Mahesh
webtrees-2.1.22
www.upavadi.net/wt-mu/
Please Log in or Create an account to join the conversation.
- RickM
-
- Offline
- Junior Member
-
Greg,Here is a module I wrote for someone which adds a number of custom tags. Copy/paste/edit the relevant looking parts.
To remove tags is slightly more involved, but uses the same principle. The "INDI" tag is defined in the class "IndividualRecord", and this specifies the allowed subtags. Create your own version of this object (with just the subtags you need) and register it in the same way as in the example module.
Thanks for the module.. Might just do the trick IF I can get the coding right
Just trying to add a custom tag under the birth event (As I think that is the right place to add GOTRA) without any other editing I added the following lines of code in the appropriate places.. I then got a blank screen
use Fisharebest\Webtrees\Elements\Birth;
'INDI:BIRT:_GOTR' => new Birth(I18N::translate('Gotra'), ),
'INDI:BIRT' => [
,
],
Looking at other code examples within the module the above should work???
I will look further at 'removing' tags in a bit..
@Mahesh May do better than I with the code, I figure I might try to save him time by attempting to sort..
Should report the Module crashes v2.2.2-dev with error
Fatal error: strict_types declaration must be the very first statement in the script in

Running in Laragon v6 with PHP v8.3.15
Rick M
Tauranga
Nu Tirani - New Zealand
alineofmalkins.com/wt-malkins
Webtrees v2.2.1
Hosted by HostAmarada on litespeed Server, PHP v8.3
Offline: WebTrees v2.2.2-dev
Laragon v6, PHP v8.3.15
Please Log in or Create an account to join the conversation.
- norwegian_sardines
-
- Offline
- Platinum Member
-
- Posts: 2569
Did you read the comment I made about GOTRA?
Ken
Please Log in or Create an account to join the conversation.
- Mahesh
-
Topic Author
- Offline
- New Member
-
I am trying to do is replicate what I have been doing for past decade on another web aplication.
NATI is very broad tag which can encompass national, religious and cultural descriptions whereas Gotra is very specific term. But I think we are getting there.
Mahesh
webtrees-2.1.22
www.upavadi.net/wt-mu/
Please Log in or Create an account to join the conversation.
- Mahesh
-
Topic Author
- Offline
- New Member
-
WEbtrees imports and displays the custom tag - in red. Which is great.
Problem arises when it is neccessary to add this info to a new record.
Again, thanks for helping me sort this issue out.
Mahesh
webtrees-2.1.22
www.upavadi.net/wt-mu/
Please Log in or Create an account to join the conversation.