Displaying persons id in front of the name

Hi guys
I am using gramps 5.1.5 on win11 and I love it.
However I am struggling to display persons id in front of persons name. This would be very helpful to me when printing calendar event book to quickly identify a right person since I have a family tree with over 2000 people and many of them have the same name. I tried with display name editor but I didn’t succeed. So it should look something like. (Id0044) john smith.

Any help is much appreciated!
Many thanks
I.

Anybody knows the answer on the question above?!

What is the report name ?

It is the report on birthdays and anniversaries. But I think the issue lays in the name format under preferences and not in the report itself. I do not know how to include “persons id” in the name format.
Thanks!

1 Like

The name format is the way you display the person name. This has nothing to do with the gramps id. If you realy want to display the gramps ID, you must cretate a feature request. Actualy, you can’t do that.

I know that id and name are two different things. But they are connected since every person has unique ID. I just want to display it in a report before actual name and surname. Too bad you can’t do that! :frowning:

There are options for the Name Display Format but they are all related to the various data elements under name record. (Which you can see listed in the upper left of the Gramp Data Model diagram.) The ID is not an element of the Name. So this enhancement isn’t a simple matter of just an existing user display preference.

It would require adding a new option to the report and changes to add to the layout of the Report.

There was another person who noted places where namesaking caused difficulties in reports & indices. {It is useful to be able to tell Leif Erikson (~970-1020) from Leif Erikson (1920-2002) or Leif Erikson (1914-2014).} So maybe some sort of disambiguation might be useful. But it might also be more complex than at first glance. The Gramps ID is auto-assigned so it doesn’t convey a lot of context. IDs might be less useful than era information. However, IDs are compact.

I like the way the configurable options of the Pedigree Gramplet has an " show dates" to disambiguate lineage that often include namesakes. (Although full dates adds a bit of clutter.)

Or in the Index report for Books

You could try to modify the report yourself. The get_name method at line 117 returns the names of the people displayed in the report. The Gramps ID can be obtained by using person.get_gramps_id().

You can replace the return line at line 140 by the two following lines:

    # return self._name_display.display_name(name)
    name_with_ID = "[ %s ] %s" % (person.get_gramps_id(), self._name_display.display_name(name))
    return name_with_ID
1 Like

Thanks for the reply. I changed line 140 in birthdayreport.py as you proposed (of course without #) and nothing happens. In Report I didn’t get the IDs.

The # means this line is commented out.
You can remove it.

Yes I removed the #
But unfortunately it doesn’t work :frowning:

You have to remove all this line to work.
If you do not, your change will not be taken into account.

Clearly:

You remove the line:

     return self._name_display.display_name(name)

and you add:

    name_with_ID = "[ %s ] %s" % (person.get_gramps_id(), self._name_display.display_name(name))
    return name_with_ID

I made a PR for 5.2:

1 Like

Yes, now it works! Thanks a lot! It will save me a lot of time when checking persons in my family tree. And thanks for the PR.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.