# genealogytree: How to save database keys in a common key

Normally at a genealogytree node I have to say
p[]{name=Jane, birth={2-2-1888}{somewhere}}

How can I create a key, like persdata=JaneID which expands to name=Jane, birth={2-2-1888}{somewhere}, so that I only have to say:
p[]{persdata=JaneID}

A not working or correct MWE:

\documentclass[landscape,paper=a5]{scrartcl}
\usepackage[all]{genealogytree}

\begin{document}
% Works not:
\pgfkeys{
persdata/.initial={name=Jane, birth={1-1-1777}{somewhere}},
persdata/.get=\persdata,
persdata/.store in=\persdata,
}
\gtrset{database/save/persdata/.get=\persdata}

\begin{tikzpicture}[]
\genealogytree[template=signpost,
processing=database,
]{
parent{
g{name=first child}
c{name=second child}
c{name=third child}
p[]{persdata=JaneID} % <---------------- Problem here....
p[]{name=works, birth={1-1-1777}{somewhere}}
}
}
\end{tikzpicture}
\end{document}

• have you tried using a .style instead? (I have no idea whether this works, I never used genealogytree and didn't take a single look, this is just a guess) – Skillmon likes topanswers.xyz Aug 5 at 10:14
• Yes, I tried a style (which would be way easier), but I get the meaning, that he wants a style "[here]", not "{here}"... – cis Aug 5 at 11:11

This answer provides a new /gtr/database key persdata that accepts predefined choices like JaneID. When persdata=JaneID is used, the corresponding key-value list stored in that style is retrieved.

\documentclass[landscape,paper=a5]{scrartcl}
\usepackage[all]{genealogytree}

\begin{document}

\gtrset{
database/.cd,
persdata/.is choice,
persdata/JaneID/.style={name=Jane, birth={1-1-1777}{somewhere}}
}

\begin{tikzpicture}[]
\genealogytree[
template=signpost,
processing=database,
]
{
parent{
g{name=first child}
c{name=second child}
c{name=third child}
p[]{persdata=JaneID}
p[]{name=works, birth={1-1-1777}{somewhere}}
}
}
\end{tikzpicture}
\end{document}


• Wow, very good! Helps me a lot. – cis Aug 5 at 13:46