Web based family history software

question-circle Question Customizing GEDCOM

  • Mahesh
  • Mahesh's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 week 3 days ago - 1 week 3 days ago #21 by Mahesh
Replied by Mahesh on topic Customizing GEDCOM
Thanks for this @RickM. I have encountered this' Fatal error: strict_types declaration must be the very first statement in the script...'  in one of my Wordpress plugins. It's PHP 8.2.xxx issue. I have not got my head around that yet.
I am looking at the module.php in  Webtrees V 2.1 and I am not getting any errors. I am not getting very far either!!

Mahesh
webtrees-2.1.22
www.upavadi.net/wt-mu/
Last edit: 1 week 3 days ago by Mahesh.

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

  • Franz Frese
  • Franz Frese's Avatar
  • Away
  • Platinum Member
  • Platinum Member
More
1 week 3 days ago #22 by Franz Frese
Replied by Franz Frese on topic Customizing GEDCOM

... Problem arises when it is neccessary to add this info to a new record. ...

 
Afaik Add is only possible with raw edit of gedcom or extending the code of webtrees direct or using a custom module.

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

  • norwegian_sardines
  • norwegian_sardines's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
More
1 week 3 days ago #23 by norwegian_sardines
Replied by norwegian_sardines 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.

Yes GOTRA is a specific term and I understand this. The problem I have with creating a new FACT in v5.5.1 GEDCOM such as GOTRA is that every time you transfer that undefined new FACT in a GEDCOM to a new program the FACT will most likely be tagged as being an error (webtrees does this) or even worse being dropped during import.

I always recommend that users of GEDCOM to follow the v5.5.1 (or v7.0) GEDCOM standard so that you can transfer your data in a uniform/standard way to other programs.

Their are two ways to implement GOTRA in the v5.5.1 GEDCOM standard.

1) Using the NATI fact with a TYPE of GOTRA.
Code:
1 NATI Kautchchhas 2 TYPE GOTRA

2) Using the FACT tag with the TYPE of GOTRA
Code:
1 FACT Kautchchhas 2 TYPE GOTRA

The display like this in v2.1 of webtrees.
 

The first one uses the FACT tag, the second uses the NATI tag.

No need to create your own fact tag, use the v5.5.1  GEDCOM Standard!

Ken

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

More
1 week 3 days ago #24 by RickM
Replied by RickM on topic Customizing GEDCOMkm

Ken,

What replaced the CREM tag in Gedcom v7??

I did read and took in what you suggested. I had a fiddle and using NATI or FACT works as you have shown. Like Mahesh says Gotra is a bit more complex than 'using' Nationality.. I suggested to Mahesh Caste might be an option. Again Mahesh thinks this is not quite right either.

My reading (Google and whatever) of Gotra is it is part of the 'Birth' Record. So what I was attempting to do with the Module suggested by Greg was add Gotra as a Sub Tag of the Birth Record INDI:BIRT:_GOTR . And indeed other programs may not pick up on this tag. And yet we do have the ability to create 'tags' to a Gedcom Standard.. Not sure if the programs do their jobs properly. But then there are issues with Gedcom Standards and application of such (another topic should be opened if one wants to discuss this further). And NO I am no Gedcom expert.

I am so appreciative of the support this WebTrees 'Team' provides. And I also appreciate that this 'Team' can accept that knocking heads sometimes happens, but it is part of finding the solution and none in the 'Team' are wanting to be rude/horrible etc..
 

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
  • norwegian_sardines's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
More
1 week 3 days ago #25 by norwegian_sardines
Replied by norwegian_sardines on topic Customizing GEDCOMkm
Sorry, my bad the CREM tag was not eliminated, I was thinking of the CEME tag!

Just because the GOTRA attribute is found on a Birth Record does not mean that we should add it to the BIRT fact.  If the Birth Record indicated the sex, skin color, hair color, number of toes, etc, we would not add subtags to the BIRT fact for these attributes, I would add another attribute either using the FACT tag or the SEX, DSCR (physical description) tag and a date for when that attribute was assigned!

Adding the _GOTRA subtag to the BIRT fact is valid GEDCOM, but not (in my opinion) the best way to incorporate the information in the GEDCOM.  But you can do what ever you want, it is your database.

Ken

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

More
1 week 3 days ago #26 by RickM
Replied by RickM on topic Customizing GEDCOMkm

Sorry, my bad the CREM tag was not eliminated, I was thinking of the CEME tag!

Just because the GOTRA attribute is found on a Birth Record does not mean that we should add it to the BIRT fact.  If the Birth Record indicated the sex, skin color, hair color, number of toes, etc, we would not add subtags to the BIRT fact for these attributes, I would add another attribute either using the FACT tag or the SEX, DSCR (physical description) tag and a date for when that attribute was assigned!

Adding the _GOTRA subtag to the BIRT fact is valid GEDCOM, but not (in my opinion) the best way to incorporate the information in the GEDCOM.  But you can do what ever you want, it is your database.
 
Ken..

I could be rude and say old age, but I won't, ROFLMAO.. I try to be a nice guy!! Joke of the Day!! I walk out of the room to do something and as soon as I pass the door, I cannot remember what I was going to do!!

Ok, you are swinging me towards the FACT tag. If Mahesh decides to go this way, IS it possible to, I'll use the word, 'setup' a Fact Tag that has Gotra as the Type and a dropdown or at least when typing into the FACT tag entry a list of various 'Gotra Facts'?? This would save repetitive typing etc.. Truth be told the more I think about this, the more I think @Mahesh would be happy with this as a solution.

Perhaps this is why @fisharebest Greg mentioned the Module?? OMG Head hurts now!!

As already said I am no Gedcom smarty pants <smile>. And I think Mahesh is still in that stage of OMG now I see what Gedcom IS, however I have no idea about  the various implications of use etc.. <Smile>.

 

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.

More
1 week 3 days ago #27 by RickM
Replied by RickM on topic Customizing GEDCOM

Thanks for this @RickM. I have encountered this' Fatal error: strict_types declaration must be the very first statement in the script...'  in one of my Wordpress plugins. It's PHP 8.2.xxx issue. I have not got my head around that yet.
I am looking at the module.php in  webtrees V 2.1 and I am not getting any errors. I am not getting very far either!!
 
Mahesh,

I'm sure you will figure it out faster than I will. Either that or maybe your son will.. I might try AI to find a solution to the Fatal Error.. Just for a lark.. It will mean I won't need to break my live site if it can be figured.. <Smile>

The answer: The
Code:
declare(strict_types=1);
directive must be the first statement in the file. so moved it to directly below
Code:
<?php
And we are now working in WebTrees v 2.2.2-dev..


I am beginning to lean towards what Ken is saying, so will hope that my question re 'setting up' a FACT tag might get a solution..

 

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.

More
1 week 3 days ago - 1 week 3 days ago #28 by Jefferson49
Replied by Jefferson49 on topic Customizing GEDCOMkm
> Is it possible to, I'll use the word, 'setup' a Fact Tag that has Gotra as the Type and a dropdown 

Yes, with a custom module, you can also create "custom types", which webtrees will show in the related dropdown menus.

I use custom types a lot for my own data and created the  MyCustomTags  module, which provides all addittional types I need for different GEDCOM elements. For example, I created additional types for INDI:EDUC. You can find the code in the following lines: The MyCustomTags module is a template how those kind of type definition can be managed. If you want to use it for your puroposes, it needs to be adopted to your specific needs. If you can specify what is needed, I can support.
  
 
Last edit: 1 week 3 days ago by Jefferson49. Reason: typos

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

  • Mahesh
  • Mahesh's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 week 3 days ago #29 by Mahesh
Replied by Mahesh on topic Customizing GEDCOMkm
@Jefferson49, that looks like what I'm looking for. I'll have a loook, tomorrow.

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 week 3 days ago #30 by norwegian_sardines
Replied by norwegian_sardines on topic Customizing GEDCOMkm

> Is it possible to, I'll use the word, 'setup' a Fact Tag that has Gotra as the Type and a dropdown 

Yes, with a custom module, you can also create "custom types", which webtrees will show in the related dropdown menus.

I use custom types a lot for my own data and created the  MyCustomTags  module, which provides all addittional types I need for different GEDCOM elements. For example, I created additional types for INDI:EDUC. You can find the code in the following lines: The MyCustomTags module is a template how those kind of type definition can be managed. If you want to use it for your puroposes, it needs to be adopted to your specific needs. If you can specify what is needed, I can support.
  

 
Jefferson49,

I'm intrigued by the possibility to create custom TYPE subtags for specific GEDCOM facts, as well as creating a limited set of custom tags using both FACT.TYPE and EVENT.TYPE facts. For example:

Adding a military tag would look like this:
1 EVEN <battle name>
2 TYPE Military

or a DNA attribute like:
1 FACT <DNA group name>
2 TYPE DNA

I also have "typed" GEDCOM tags entries like:

1 MARR
2 TYPE Civil

1 MARR
2 TYPE Religious

I'm not a PHP programmer, but if your module is well documented I may be able to work something up when I have time!

Ken

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

More
1 week 3 days ago #31 by RickM
Replied by RickM on topic Customizing GEDCOMkm

> Is it possible to, I'll use the word, 'setup' a Fact Tag that has Gotra as the Type and a dropdown 

Yes, with a custom module, you can also create "custom types", which webtrees will show in the related dropdown menus.

I use custom types a lot for my own data and created the  MyCustomTags  module, which provides all addittional types I need for different GEDCOM elements. For example, I created additional types for INDI:EDUC. You can find the code in the following lines: The MyCustomTags module is a template how those kind of type definition can be managed. If you want to use it for your puroposes, it needs to be adopted to your specific needs. If you can specify what is needed, I can support.
  

 
A Very quick one line addition got this working for a FACT tag.. We can set the FACT type Gotra by Dropdown selection And once used the FACT can be added by typing in first time then start typing and options appear..

There is probably a bit of stuff not required.. @Jefferson49 are you ok if I or, @Mahesh and or @norwegian_sardines and or any other who may want to, make alterations to your module to suit individual requirements?? That mentioning add or remove code to suit!!

Wow, great stuff @Jefferson49

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.

More
1 week 3 days ago #32 by Jefferson49
Replied by Jefferson49 on topic Customizing GEDCOMkm
> There is probably a bit of stuff not required..  @Jefferson49  are you ok if I or,  @Mahesh  and or  @norwegian_sardines  and or any other who may want to, make alterations to your module to suit individual requirements?? That mentioning add or remove code to suit!!

Yes, you are welcome! Indeed, this is the reason why I shared the module on Github. The module contains the code structures based on my own types, which obviously do not suit for others. Therefore, it shall be adopted to other users needs.

Some time ago, I have started to take first steps to make the types customizable in the webtrees front end. I might publish a customizable version in the future.

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

  • Franz Frese
  • Franz Frese's Avatar
  • Away
  • Platinum Member
  • Platinum Member
More
1 week 3 days ago #33 by Franz Frese
Replied by Franz Frese on topic Customizing GEDCOM
I am not a friend of creating own tags.
A custom tag will probably not be used often in your data and for sure not in other peoples data and/or genealgy software.
Splittering a life into tags is not useful at all. you should not compare lifes this way.
I would use a simple note.

p.s.: I dont know what a Gotra is, it never came up in my life and the life of the people I know. 
pps: don't put people in a drawer by using tags. Let people as they are. Religion, and so on ... doesn't matter, people are humans with dignity and rights.

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

More
1 week 3 days ago #34 by RickM
Replied by RickM on topic Customizing GEDCOMkm

> There is probably a bit of stuff not required..  @Jefferson49  are you ok if I or,  @Mahesh  and or  @norwegian_sardines  and or any other who may want to, make alterations to your module to suit individual requirements?? That mentioning add or remove code to suit!!

Yes, you are welcome! Indeed, this is the reason why I shared the module on Github. The module contains the code structures based on my own types, which obviously do not suit for others. Therefore, it shall be adopted to other users needs.

Some time ago, I have started to take first steps to make the types customizable in the webtrees front end. I might publish a customizable version in the future.
 
Thank You So Much..

Still have some questions to followup with not so much with the Module, but there may be a few.

I and prob Mahesh will need some guidance using find and replace regex to change the current Gedcom tag for Gotra to an INDI Fact being xxx (a few different xxx's) with type being Gotra.
 

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.

More
1 week 3 days ago #35 by RickM
Replied by RickM on topic Customizing GEDCOM

 


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.

More
6 days 22 hours ago #36 by fisharebest
Replied by fisharebest on topic Customizing GEDCOM
> 'INDI:BIRT:_GOTR' => new Birth(I18N::translate('Gotra'), ),

You have based your tag on "Birth". This means it will get the same subtags as "Birth", which is probably not what you want.

It may be better to use "CustomElement" instead.

Also, your screenshot shows "INDI:GOTRA", but you are adding "INDI:BIRT:_GOTR"

These are different. Do you want this to be a "top level" fact, or an attribute of the birth?

I guess a top-level attribute would be better.
I don't know what subtags you want here, but SOUR and NOTE are probably a good choice.

According to Wikipedia, Gotra can have one of 8 values. If this is correct, then you can create your own Gotra tag with the 8 options defined. This will make data entry simpler. Look at the NameType element to see how this is implemented.

> Fatal error: strict_types declaration must be the very first statement in the script

As the error says, strict_types must be the first PHP statement in a script. You presumably have other statements above it. Can't give more help without seeing your code.

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
6 days 18 hours ago #37 by Mahesh
Replied by Mahesh on topic Customizing GEDCOM
I'm overwhelmed by the support you all have given me. I've been working with databases since the 1980s, but this is my first experience with GEDCOM, and I can already tell there's a lot to learn.
Having looked at the solutions by Greg,  @fisharebest and @Jefferson49, my son were inspired and thought we 'll have a go at some simple suff. So with help of AI to do the hard suff, we got a short module ( github.com/upavadi/intl_hindu ) that generates the following:
Code:
1 FACT 2 TYPE GOTRA 2 DATA Bhardwaj
I'm quite pleased that we were able to accomplish this. Once I gain a deeper understanding of the GEDCOM standard, I may revisit this to see if any improvements are needed.Thank you, everyone! I also have a couple of questions about data migration, so I'll be back soon.

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
6 days 18 hours ago #38 by norwegian_sardines
Replied by norwegian_sardines on topic Customizing GEDCOM
Code:
1 FACT 2 TYPE GOTRA 2 DATA Bhardwaj

I would not do this, rather I would do this:
Code:
1 FACT Bhardwaj 2 TYPE GOTRA


 

Ken

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

More
6 days 13 hours ago #39 by RickM
Replied by RickM on topic Customizing GEDCOM

> Fatal error: strict_types declaration must be the very first statement in the script

As the error says, strict_types must be the first PHP statement in a script. You presumably have other statements above it. Can't give more help without seeing your code.
Greg,

Thanks for the response and info.. I shall indeed check things further.. 

With regard to the Error, it is generated from the amitys-dot-com module.php.. there are three commented lines above the declare statement, so I moved the declare statement to under the <?php..

 

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
4 days 19 hours ago - 4 days 19 hours ago #40 by Mahesh
Replied by Mahesh on topic Customizing GEDCOM
Thanks @Ken.
I take your point. Gedcom presents a steep learning curve, but I am slowly getting there.
I have another issue with this module where "removing atag from dropdown list" is not working. I shall come back to this when I have some deeper understanding.

Mahesh
webtrees-2.1.22
www.upavadi.net/wt-mu/
Last edit: 4 days 19 hours ago by Mahesh.

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

Powered by Kunena Forum