Question
Customizing GEDCOM
- Mahesh
-
Topic Author
- Offline
- New Member
-
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/
Please Log in or Create an account to join the conversation.
- Franz Frese
-
- Away
- Platinum Member
-
Afaik Add is only possible with raw edit of gedcom or extending the code of webtrees direct or using a custom module.... Problem arises when it is neccessary to add this info to a new record. ...
Please Log in or Create an account to join the conversation.
- norwegian_sardines
-
- Offline
- Platinum Member
-
- Posts: 2549
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.
2) Using the FACT tag with the TYPE of 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.
- RickM
-
- Offline
- Junior Member
-
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
-
- Offline
- Platinum Member
-
- Posts: 2549
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.
- RickM
-
- Offline
- Junior Member
-
Ken..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.
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.
- RickM
-
- Offline
- Junior Member
-
Mahesh,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!!
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
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.
- Jefferson49
-
- Offline
- Senior Member
-
- Posts: 309
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:
- github.com/Jefferson49/MyCustomTags/blob...yCustomTags.php#L178
- github.com/Jefferson49/MyCustomTags/blob...ducationType.php#L35
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.
- norwegian_sardines
-
- Offline
- Platinum Member
-
- Posts: 2549
Jefferson49,> 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.
- github.com/Jefferson49/MyCustomTags/blob...yCustomTags.php#L178
- github.com/Jefferson49/MyCustomTags/blob...ducationType.php#L35
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.
- RickM
-
- Offline
- Junior Member
-
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..> 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.
- github.com/Jefferson49/MyCustomTags/blob...yCustomTags.php#L178
- github.com/Jefferson49/MyCustomTags/blob...ducationType.php#L35
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.
- Jefferson49
-
- Offline
- Senior Member
-
- Posts: 309
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
-
- Away
- Platinum Member
-
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.
- RickM
-
- Offline
- Junior Member
-
Thank You So Much..> 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.
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.
- 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.
- fisharebest
-
- Offline
- Administrator
-
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
-
Topic Author
- Offline
- New Member
-
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:
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: 2549
I would not do this, rather I would do this:
Ken
Please Log in or Create an account to join the conversation.
- RickM
-
- Offline
- Junior Member
-
Greg,> 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.
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
-
Topic Author
- Offline
- New Member
-
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/
Please Log in or Create an account to join the conversation.