GravityKit / GravityView

The best and easiest way to display Gravity Forms entries on your website.
https://www.gravitykit.com/products/gravityview/
245 stars 63 forks source link

Add ability to only show first letter of name fields #1965

Closed zackkatz closed 1 week ago

zackkatz commented 9 months ago

Often, you may want to show someone's name as {First Name} {First Letter}.; "Janice M." for example.

To implement:

Here's what Claude AI says:

Initials are used in various ways across different languages and cultures. Here's a brief overview:

English:

Typically use the first letter of the first name and last name (e.g., J.K. Rowling)
Middle initials are sometimes included (e.g., John F. Kennedy)

Chinese:

Usually use the first letter of the surname followed by the first letter(s) of the given name(s)
Example: Wang Xiaoming might be W.X. or W.X.M.

Russian:

Often use three initials: first name, patronymic (father's name), and surname
Example: Alexander Sergeyevich Pushkin might be A.S.P.

Japanese:

Initials are not commonly used in Japanese culture
When used (mostly in international contexts), they follow the Western style

Arabic:

Initials are not traditionally used
In modern contexts, they may follow the Western style when needed

Spanish:

May include initials for both surnames (paternal and maternal)
Example: Gabriel García Márquez might be G.G.M.

Korean:

Initials are not traditionally used
In international contexts, they may use the first letter of the surname followed by given name initials

French:

Similar to English usage, but may include more middle initials
Example: Jean-Paul Charles Aymard Sartre might be J.-P.C.A.S.

These practices can vary depending on personal preference, formal vs. informal contexts, and specific regional or cultural norms. Would you like me to elaborate on any particular language or aspect of initial usage?
omarkasem commented 3 weeks ago

@zackkatz We can achieve it all except the English ones like (e.g., J.K. Rowling) (e.g., John F. Kennedy) For that we might want to add merge tags modifier so they would be on the same line in view table. Let me know what you think.

screenshot-gv local-2024 09 14-14_10_33 (1)

zackkatz commented 3 weeks ago

@omarkasem That looks good enough for now! We can adjust as-needed in the future.

rafaehlers commented 6 days ago

@zackkatz, we should have included a merge tag modifier for name fields as well. This we could do something like this:

[gvlogic if="{Donate anonymously?:2}"]
    {Name:1.1:initials}, {Name:1.3:initials}
[else]
    {Name:1}
[/gvlogic]

What do you think?

zackkatz commented 5 days ago

@rafaehlers That's a good idea!