Before asking for help please read "Requesting Help and Suggestions" by clicking on that tab above here.
  • Page:
  • 1

TOPIC:

Surnames Dropdown 1 week 4 days ago #1

  • sandhya
  • sandhya's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 7
How do I restrict users to choose family last name or surname from a custom table only using drop down? I would like to apply this to All areas wherever surname is editable. Including when choosing parents surnames or when entering Spouse Name or Maternal Family Names

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

Surnames Dropdown 1 week 4 days ago #2

  • hermann
  • hermann's Avatar
  • Offline
  • Premium Member
  • Premium Member
  • Posts: 829
For me, this cannot work. If you have to add the name of the mother of somebody, her birth name is in many cases a totally new name.
Hermann
Designer of the custom module "Extended Family"

webtrees 2.1.16 (all custom modules installed, PHP 8.2, MySQL 5.7) @ ahnen.hartenthaler.eu

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

Surnames Dropdown 1 week 4 days ago #3

  • sandhya
  • sandhya's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 7
for my closed community need, this is the only way to implement.

In the database along with list of surnames I will have row for Other . So in this scenario they will select Other in dropdown. But As soon as they select other, I would like to restrict that branch extension.

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

Surnames Dropdown 1 week 4 days ago #4

  • sandhya
  • sandhya's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 7
for my closed community need, this is the only way to implement.

In the database along with list of surnames I will have row for Other . So in this scenario they will select Other in dropdown. But As soon as they select other, I would like to restrict that branch extension.

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

Surnames Dropdown 1 week 4 days ago #5

  • sandhya
  • sandhya's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 7
for my closed community need, this is the only way to implement.

In the database along with list of surnames I will have row for Other . So in this scenario they will select Other in dropdown. But As soon as they select other, I would like to restrict that branch extension.

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

Surnames Dropdown 1 week 4 days ago #6

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 17010
Surnames are stored in the SURN field in a GEDCOM file.

SURN fields are handled by the code in /app/Elements/NamePieceSurname.php

This has a function edit() which creates an edit control.

You would need to create your own version of this file, with your own edit() function, which in turn creates the HTML <select> element.

Then you'd need a simple module which registers your version of this code. Just add this function to the example module.

public function boot(): void
{
Registry::elementFactory()->registerTags();
}
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - @fisharebest@phpc.social - fisharebest.webtrees.net

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

  • Page:
  • 1
Powered by Kunena Forum