Web based family history software

question-circle Question Customizing GEDCOM

  • Mahesh
  • Mahesh's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 month 3 weeks ago #1 by Mahesh
Customizing GEDCOM was created by Mahesh
Hi All.
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,
  1. add one or two GEDCOM tags
  2. supress few GEDCOM Tags from appearing in dropdown lists like in Add a fact.
Is this possible?
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.

More
1 month 3 weeks ago #2 by Peter_S
Replied by Peter_S on topic Customizing GEDCOM
Hello Mahesh,

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
  • norwegian_sardines's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
More
1 month 3 weeks ago - 1 month 3 weeks ago #3 by norwegian_sardines
Replied by norwegian_sardines on topic Customizing GEDCOM
Before we can even advise you on how to:

  1. add one or two GEDCOM tags
  2. 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:
Code:
1 FACT WWII Participation 2 TYPE Military

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
Last edit: 1 month 3 weeks ago by norwegian_sardines.

Please Log in or Create an account to join the conversation.

More
1 month 3 weeks ago #4 by Franz Frese
Replied by Franz Frese on topic Customizing GEDCOM
I do not like answering questions, that are not asked.
Please be more concrete.

Please Log in or Create an account to join the conversation.

  • Mahesh
  • Mahesh's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 month 3 weeks ago #5 by Mahesh
Replied by Mahesh on topic Customizing GEDCOM
Thank you so much  Peter_S norwegian_sardines   for responding. My apologies for not explaining my issue. 
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
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.
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
  • norwegian_sardines's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
More
1 month 3 weeks ago - 1 month 3 weeks ago #6 by norwegian_sardines
Replied by norwegian_sardines on topic Customizing GEDCOM
Obviously you are trying to be closed lip about your use of webtrees, but never-the-less you can certainly create your own facts with GEDCOM and with some coding changes remove all other Fact/Event tags within webtrees. 

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:
Code:
1 FACT <Value> 2 TYPE <CustomTag>

Ken
Last edit: 1 month 3 weeks ago by norwegian_sardines.

Please Log in or Create an account to join the conversation.

More
1 month 3 weeks ago #7 by drblam
Replied by drblam on topic Customizing GEDCOM

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.

 
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,
  1. the first line you've shown "
    Code:
    1 CustomTag Tag value
    " is buried in the middle of some previous logical record
  2. since you second line "
    Code:
    1 FAMC @F2@
    " has the same level as the first, it is a separate sub-record, belonging to the parent (not shown) and completely unrelated to line 1. Thus, those two lines can be reversed without changing the meaning of the GEDCOM.
  3. since the last line you've shown "
    Code:
    0 @I5@ INDI
    " has tag level zero, it is the beginning of a new and completely independent logical record, and has nothing to do with your custom tag.
So you've created yourself a new custom tag, which you've called "FOO" say, and then added some lines of the form ""
Code:
1 FOO bar
" into your exported GEDCOM file. How is webtrees or any other program supposed to interpret it, beyond assuming it belongs to the most-recent previous level zero logical record?  I hope you have at least followed the convention that custom tags start with an underscore like this "_FOO" so the rest of the world knows you didn't make a typing mistake and really meant to do something proprietary.

Please Log in or Create an account to join the conversation.

  • fisharebest
  • fisharebest's Avatar
  • Away
  • Administrator
  • Administrator
More
1 month 3 weeks ago #8 by fisharebest
Replied by fisharebest on topic Customizing GEDCOM
Adding your own custom tags and subtags (or overriding default tags) needs some PHP code, which can be put in a "webtrees module".

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.

More
1 month 3 weeks ago #9 by RickM
Replied by RickM on topic Customizing GEDCOM
@Mahesh

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
  • Mahesh's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 month 3 weeks ago - 1 month 3 weeks ago #10 by Mahesh
Replied by Mahesh on topic Customizing GEDCOM
@drblam 

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!
Code:
@I580@ INDI 1 NAME xxxxxxxxxx  /Travadi/ 2 GIVN xxxxxxxxxxxx 2 SURN Travadi 1 SEX M 1 BIRT 2 DATE 7 Jul 1896 2 PLAC India 1 DEAT 2 DATE 1 Oct 1961 2 PLAC Nairobi, Kenya 2 CAUS Kidney Failure ###### CUSTOM TAG ADDED ###### 1 CREM 2 DATE 1 Oct 1961 2 PLAC Nairobi, Kenya 1 CustomTag Tag value  ############ CUSTOM TAG ADDED ##### 1 NOTE Worked as Cook,Clerk and then Advocate. Emigrated from India to Kenya, circa.1917. Worked in Attorney-General's office 1922-1947. He became a Barrister at the age of 50. Later, he became a Member of the Legislative Council. 2 CONT Attended <a href="http://en.wikipedia.org/wiki/File:Lancaster_House_Conference_for_Kenya%27s_Independance.jpg  "target="_blank"> Lancaster House conference</a> in 1960, in which Kenya`s constitutional framework and independence were negotiated. 2 CONC : See Photo: (Karsanji Travadi, 2nd from left) 1 OBJE @M24@ 2 _PRIM Y 1 OBJE @M54@ 1 OBJE @M625@ 1 FAMC @F67@ 1 FAMS @F265@ 1 CHAN 2 DATE 24 Feb 2022  ##### LAST MODIFIED DATE ############

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/
Last edit: 1 month 3 weeks ago by Mahesh.

Please Log in or Create an account to join the conversation.

  • norwegian_sardines
  • norwegian_sardines's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
More
1 month 3 weeks ago - 1 month 3 weeks ago #11 by norwegian_sardines
Replied by norwegian_sardines on topic Customizing GEDCOM

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
Last edit: 1 month 3 weeks ago by norwegian_sardines.

Please Log in or Create an account to join the conversation.

More
1 month 3 weeks ago - 1 month 3 weeks ago #12 by drblam
Replied by drblam on topic Customizing GEDCOM
Thank you for supplying a more complete example. First you say there are TWO custom tags that were defined by your current software. I assume you mean the two lines your code sample with added comments "CUSTOM TAG ADDED".

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
Code:
1 CustomTag Tag value  ############ CUSTOM TAG ADDED #####
is more of an issue. I used the blue edit button on the top-right corner of an Individual page to "Open the raw GEDCOM", which displays the raw code for this Individual record as a series of boxes showing its constituent level-one sub-records. At the very bottom is a blank box labeled "Add a fact". When I typed (literally) "1 CustomTag Tag value" into this box, it highlighted the box in red with an error symbol in the corner and refused to save my changes. However, when I typed (literally) "1 FOO bar" into this box, it was happy to save my changes. When the refreshed Individual page reappeared, it appeared as a new row in the list of facts and events. Everything I typed was displayed correctly, but in the first column "INDI:FOO" is shown in bright red because webtrees doesn't understand it.



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.
Last edit: 1 month 3 weeks ago by drblam.

Please Log in or Create an account to join the conversation.

  • fisharebest
  • fisharebest's Avatar
  • Away
  • Administrator
  • Administrator
More
1 month 3 weeks ago #13 by fisharebest
Replied by fisharebest on topic Customizing GEDCOM
> The link you shared is not working.

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
  • Mahesh's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 month 3 weeks ago #14 by Mahesh
Replied by Mahesh on topic Customizing GEDCOM
Thanks Greg. I shall let you know how get on.

Mahesh
webtrees-2.1.22
www.upavadi.net/wt-mu/

Please Log in or Create an account to join the conversation.

More
1 month 3 weeks ago #15 by RickM
Replied by RickM on topic Customizing GEDCOM

Thanks Greg. I shall let you know how get on.
 
@Mahesh
Have you got my emails??

Rick

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
  • Mahesh's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 month 3 weeks ago #16 by Mahesh
Replied by Mahesh on topic Customizing GEDCOM
Apologies for delay, Rick. I shall respond, today.

Mahesh
webtrees-2.1.22
www.upavadi.net/wt-mu/

Please Log in or Create an account to join the conversation.

More
1 month 3 weeks ago - 1 month 3 weeks ago #17 by RickM
Replied by RickM on topic Customizing GEDCOM

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.

 
Greg,

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 D:\Dev_Sites\wt-Malkins\modules_v4\amitys-dot-com-main\module.php on line 7

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
Last edit: 1 month 3 weeks ago by RickM. Reason: Added re Dev Version Crashing

Please Log in or Create an account to join the conversation.

  • norwegian_sardines
  • norwegian_sardines's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
More
1 month 3 weeks ago #18 by norwegian_sardines
Replied by norwegian_sardines on topic Customizing GEDCOMkm
RickM,

Did you read the comment I made about GOTRA?

Ken

Please Log in or Create an account to join the conversation.

  • Mahesh
  • Mahesh's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 month 3 weeks ago - 1 month 3 weeks ago #19 by Mahesh
Replied by Mahesh on topic Customizing GEDCOM
Thanks @norwegian_sardines. I understand what you are saying.
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/
Last edit: 1 month 3 weeks ago by Mahesh.

Please Log in or Create an account to join the conversation.

  • Mahesh
  • Mahesh's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 month 3 weeks ago - 1 month 3 weeks ago #20 by Mahesh
Replied by Mahesh on topic Customizing GEDCOM
@drblam my bad. I muddled the whole issue by quoting custom tag. What I meant was a tag custom made.
 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/
Last edit: 1 month 3 weeks ago by Mahesh.

Please Log in or Create an account to join the conversation.

Powered by Kunena Forum