I have been told a number of times now, that I should consider implementing a key-value version of my method \createPerson. I wan't to do this, but my problem is that I don't know how to go on with it. Could you help me get started and explain how it works?
The \createPerson command places the argument in different positions based on what arguments are available and also only creates the absolutely neccesary rows.
Here is a minimum code sample of how I am using the method:
\documentclass{article}
\usepackage{tikz}
\usepackage{datetime}
\usepackage[danish]{varioref}
\usepackage{hyperref}
\usepackage{xifthen}
\RequirePackage[framemethod=TikZ]{mdframed}
\usepackage{multirow, tabularx}
\usepackage[]{units}
\usepackage{xparse}
\usepackage{adjustbox}
%=========================================================================
% CREATE PERSON NEW
%=========================================================================
%Arguments:
% 1) MANDATORY - Image destination
% 2) [OPTIONAL] - Called name
% 3) MANDATORY - Reference to the current full name
% 4) [OPTIONAL] - Full birth name
% 5) MANDATORY - Uniqueue Reference number
% 6) [OPTIONAL] - Birth date in the format of dd. mmm. yyyy
% 7) <OPTIONAL> - Death date in the format of dd. mmm. yyyy
\NewDocumentCommand\createPerson{r<>omomo+d<>}
{
\begin{mdframed}[style=whiteBox]%
\profileImage[width=0.25\textwidth]{#1}
\begin{tabularx}{0.75\textwidth}[t]{lXrc}%
% Row one
Navn: & \nameref{#3} & \textlabel{#5}{PERSON_ID:#3} & $\Re$%
%Create new row if needed
\IfNoValueTF{#2}%
{\IfNoValueTF{#4}%
{\IfNoValueTF{#6}%
{\IfNoValueTF{#7}%
{}%
{\\}}%
{\\}}%
{\\}}%
{\\}%
% Row two
\IfNoValueTF{#4}%
% If no birth name
{\IfNoValueTF{#2}%
% If no called name
{&&}%
% If a called name
{Kaldenavn: & \textlabel{#2}{KN:#3} &}}%
%If a birth name
{Fødenavn: & #4 &}%
%
\IfNoValueTF{#6}%
% If no birth date
{\IfNoValueTF{#7}{}{\textlabel{#7}{DD:#3} & \cross}}%
{\textlabel{#6}{FD:#3} & $\star$}%
% Create new row if needed
\IfNoValueTF{#2}%
{%
\IfNoValueTF{#6}%
{}%
{\IfNoValueTF{#7}%
{}%
{\\}%
}%
}%
{\IfNoValueTF{#4}%
{\IfNoValueTF{#6}%
{}%
{\IfNoValueTF{#7}%
{}%
{\\}%
}%
}%
{\\}%
}%
% Row three
\IfNoValueTF{#2}%
% If no called name
{%
\IfNoValueTF{#6}%
{}%
{\IfNoValueTF{#7}%
{}%
{&&}%
}%
}%
% If a called name
{\IfNoValueTF{#4}%
% If no birth name
{
\IfNoValueTF{#6}%
{}%
{\IfNoValueTF{#7}%
{}%
{&&}%
}%
}%
%If birth name
{Kaldenavn: & \textlabel{#2}{KN:#3} &}%
}%
%
\IfNoValueTF{#7}%
% If no death date
{}%
{\IfNoValueTF{\textlabel{#6}{FD:#3}}{}{\textlabel{#7}{DD:#3} & \cross}}%
\end{tabularx}%
\end{mdframed}%
}
%=========================================================================
% TEXT LABEL
%=========================================================================
\makeatletter%
% Arguments:
% 1) The text
% 2) The label
\newcommand*{\textlabel}[2]{%
\edef\@currentlabel{#1}% Set target label
#1\phantomsection\label{#2}% Print and store label
}
\makeatother
\mdfdefinestyle{whiteBox}{%
linecolor=black,
outerlinewidth=0.75pt,
roundcorner=6pt,
innertopmargin=10pt,
innerbottommargin=10pt,
innerrightmargin=10pt,
innerleftmargin=10pt,
backgroundcolor=white,
outermargin=0cm,
nobreak=true,
align=center}
%=========================================================================
% Profile image in border
%=========================================================================
\newsavebox\profileImageBox
\NewDocumentCommand{\profileImage}%
{O{width=0.6\linewidth}
O{draw=black,line width=0.75pt,rounded corners=6pt}
m}{%
\savebox\profileImageBox{\includegraphics[#1]{#3}}%
\begin{adjustbox}{valign=t}
\begin{tikzpicture}%
\draw [path picture={%
\node at (path picture bounding box.center) {%
\usebox\profileImageBox};},#2]
(0,0) rectangle (\wd\profileImageBox,\ht\profileImageBox);
\end{tikzpicture}%
\end{adjustbox}%
}
%=========================================================================
% Cross
%=========================================================================
\newcommand{\cross}[1][.7pt]{\ooalign{%
\rule[1ex]{1ex}{#1}\cr% Horizontal bar
\hss\rule{#1}{.7em}\hss\cr}% Vertical bar
}
\begin{document}
\section{Carl Wilhelm Larsen}
\label{CarlWilhelmLarsen1867}
\createPerson%
<summer>%
[Carl]%
{CarlWilhelmLarsen1867}%
{315}%
[5 maj 1867]%
<18 maj 1953>%
\end{document}

tex-obj. There is key/value interface support in expl3. – Sean Allred Dec 15 '15 at 21:56