1

While working on Biblatex: Two citation style for the same 'commentary'-type I have created to separate bibliography styles / types for German legal commentaries, namely commentary:title and commentary:editor. The citation and the bibliography entries work as expected.

However, there is a sorting problem: Entries with type = commentary:title have to be sorted by title, whereas entries with the type commentary:editor have to sorted by editor.

Here is the current MWE demonstrating the problem. Zivilprozessordnung needs to be last, Erfurter Kommentar zum Arbeitsrecht needs to be first. Note that I will not only use commentaries, so any solution will have to apply to article, book and incollection as well.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}

\usepackage{filecontents}
\begin{filecontents}{jobname.bib}

@COMMENTARY:EDITOR{palandt,
    editor = {Palandt, Otto},
    editortype = {founder},
    YEAR = {2019},
    TITLE = {Bürgerliches Gesetzbuch mit Nebengesetzen},
    EDITION = {79},
    ISBN = {978-3-406-73800-5},
    PUBLISHER = {C.H. Beck},
    ADDRESS = {München},
    shorthand = {Palandt},
    addendum   = {(zit. als Palandt/\emph{Bearbeiter})}
    %OPTIONS = {howcited},
}

@COMMENTARY:TITLE{muekobgb,
  maintitle  = {Münchener Kommentar zum Bürgerlichen Gesetzbuch},
  editor     = {Säcker, Franz},
  volume     = {1},
  title      = {Allgemeiner Teil},
  edition    = {7},
  address    = {München},
  year       = {2015},
  shorthand  = {MüKoBGB},
  addendum   = {(zit. als MüKoBGB/\emph{Bearbeiter})}
  %OPTIONS    = {howcited},
}

@COMMENTARY:TITLE{hdbversr,
  maintitle  = {Ver\-sicherungs\-rechts-Hand\-buch},
  editor     = {Beckmann, Roland Michael and Matusche-Beckmann, Annemarie},
  edition    = {3},
  address    = {München},
  year       = {2015},
  shorthand  = {VersRHdb},   
  %OPTIONS    = {howcited},
  addendum = {(zit. als \emph{Bearbeiter} in: VersRHdb)},
}

@COMMENTARY:EDITOR{maunzduerig,
  maintitle  = {Grundgesetz},
  editor     = {Maunz,  Theodor  and  Dürig,  Günter},
  editortype = {founder},
  edition    = {80. Erg.-Lfrg., Juni 2017},
  address    = {München},
  %year       = {2015},
  shorthand  = {Maunz/Dürig},   
  %OPTIONS    = {howcited},
  addendum = {(zit. als \emph{Bearbeiter} in: Maunz/Dürig)},  
}

@COMMENTARY:TITLE{erfk,
  maintitle  = {Erfurter Kommentar zum Arbeitsrecht},
  editor     = {Müller-Glöge, Rudi and Preis, Ulrich and Schmidt, Ingrid},
  edition    = {16},
  address    = {München},
  year       = {2016},
  shorthand  = {ErfK},
  addendum   = {(zit. als ErfK/\emph{Bearbeiter})}
  %OPTIONS    = {howcited},
}

@COMMENTARY:TITLE{blah,
  maintitle  = {Zivilprozessordnung. Mit FamFG, GVG und anderen Nebengesetzen},
  editor     = {Baumbach, Adolf and Lauterbach, Wolfgang and Albers, Jan and Hartmann, Peter},
  edition    = {74},
  address    = {München},
  year       = {2016},
  shorthand  = {BLAH},
  addendum   = {(zit. als BLAH/\emph{Bearbeiter})}
  %OPTIONS    = {howcited},
}

@COMMENTARY:TITLE{blah2,
  maintitle  = {Zivilprozessordnung mit verschiedenen Editor-Typen},
  editor     = {Baumbach, Adolf},
  editortype = {founder},
  editora    = {Lauterbach, Wolfgang}, 
  editoratype = {continuator},
  editorb    = {Albers, Jan and Hartmann, Peter},
  editorbtype = {editor},
  edition    = {74},
  address    = {München},
  year       = {2016},
  shorthand  = {BLAH2},
  addendum   = {(zit. als BLAH2/\emph{Bearbeiter})}
  %OPTIONS    = {howcited},
}

@COMMENTARY:TITLE{staudinger,
  maintitle  = {Kommentar zum Bürgerlichen Gesetzbuch},
  editor     = {Staudinger, J. von},
  editortype = {founder},

}
\end{filecontents}

\usepackage[%
  backend=biber,%
  sorting=nty,%
  sortcites=true,%
  maxnames=4,%
  minnames=4,%
  style=ext-authortitle-ibid,%
  articlein=false,%
  %innamebeforetitle=true,
  useprefix=true,%
  isbn=false,%
]{biblatex}
\usepackage[babel, german=quotes]{csquotes}
\usepackage{xpatch}
\addbibresource{jobname.bib}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Globale Änderungen
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%Namen kursiv (außer bei commentary:title)
\renewcommand*{\mkbibnamefamily}[1]{%
  \ifboolexpr{%
    test {\ifentrytype{commentary:title}}%
    }%
  {}%
  \mkbibemph{#1}}

\renewcommand*{\mkbibnamegiven}[1]{%
  \ifboolexpr{
    test {\ifentrytype{commentary:title}}
    }%
  {}%
  \mkbibemph{#1}}

\renewcommand*{\mkbibnameprefix}[1]{%
  \ifboolexpr{
    test {\ifentrytype{commentary:title}}
    }%
  {}%
  \mkbibemph{#1}}

\renewcommand*{\mkbibnamesuffix}[1]{%
\ifboolexpr{
    test {\ifentrytype{commentary:title}}
    }%
  {}%
  \mkbibemph{#1}}

%Im Literaturverzeichnis Doppelpunkt nach Namen, kein Punkt
\renewcommand*{\labelnamepunct}{\addcolon\space} 

%  Schrägstriche zwischen den Autoren 
\renewcommand*{\multinamedelim}{\addslash}% 
\renewcommand*{\finalnamedelim}{\multinamedelim}%

% ebd. kursiv
\renewcommand*{\mkibid}{\mkbibemph}

% Keine Ausgabe des Verlags
\AtEveryCitekey{\clearlist{publisher}}
\AtEveryBibitem{\clearlist{publisher}}

% Keine Ausgabe des Ortes
%\AtEveryCitekey{\clearlist{location}}
%\AtEveryBibitem{\clearlist{location}}

% Namen sortiert als Nachname, Vorname
\DeclareNameAlias{sortname}{family-given}

% Kein Punkt am Ende des Eintrags im LitVZ
%\renewcommand{\finentrypunct}{}

% kein Punkt nach Addendum
\renewcommand*{\finentrypunct}{%
  \iffieldundef{addendum}%
    {\addperiod}%
    {}%
  }

% 'Auflage' statt 'Aufl.'
%\DefineBibliographyStrings{german}{%
%  edition = {\ifbibliography{Auflage}{Aufl\adddot}},%
%}%

% Erkennt Satzzeichen & setzt kein Komma ausser bei Abkurzungen
%\DefineBibliographyExtras{german}{\DeclarePunctuationPairs{comma}{*}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Definition von 'commentary'
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\DeclareBibliographyDriver{commentary:editor}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{author/editor+others/translator+others}%
  \setunit{\printdelim{nametitledelim}}%
  \newblock
  \usebibmacro{maintitle+title}%
  \newunit\newblock
  \usebibmacro{byauthor}%
  \newunit\newblock
  \usebibmacro{byeditor+others}%
  \newunit\newblock
  \printfield{edition}%
  %\newunit
  %\usebibmacro{location+date}%
  \setunit*{\addcomma\space}%
  \printlist{location}%
  \setunit*{\space}%
  \usebibmacro{date}%
  \newunit\newblock
  \usebibmacro{addendum+pubstate}%
  \setunit{\bibpagerefpunct}%
  \newblock
  \usebibmacro{finentry}}

\DeclareBibliographyDriver{commentary:title}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{maintitle+title}% neu
  \newunit\newblock% neu
  \usebibmacro{author/editor+others/translator+others}%
  \setunit{\printdelim{nametitledelim}}%
  \newblock
  %\usebibmacro{maintitle+title}%
  %\newunit\newblock
  \usebibmacro{byauthor}%
  \newunit\newblock
  \usebibmacro{byeditor+others}%
  \newunit\newblock
  \printfield{edition}
  %\newunit
  %\usebibmacro{location+date}%
  \setunit*{\addcomma\space}%
  \printlist{location}%
  \setunit*{\space}%
  \usebibmacro{date}%
  \newunit\newblock
  \newunit\newblock
  \usebibmacro{addendum+pubstate}%
  \setunit{\bibpagerefpunct}%
  \newblock
  \usebibmacro{finentry}}

\let\oldpostnotedelim\postnotedelim
\renewcommand*{\postnotedelim}{  
  \ifboolexpr{
    test {\ifentrytype{commentary:editor}}
    or
    test {\ifentrytype{commentary:title}}
    }%
  {}%
  {\oldpostnotedelim}} 

\DeclareFieldFormat{postnote:stem}{\oldpostnotedelim\mkpageprefix[pagination][\mknormrange]{#1}}
\DeclareFieldFormat{postnote:prefix}{\addslash\mkbibemph{#1}}
\DeclareFieldFormat{postnote}{\mkpostnote{#1}}

\makeatletter
\newrobustcmd*{\mkpostnote}[1]{\mkpostnote@i#1&}

\def\mkpostnote@i{%
  \@ifnextchar(%)
    {\mkpostnote@ii}
    {\mkpostnote@ii()}}

\def\mkpostnote@ii(#1)#2&{%
  \ifblank{#1}{}{%
    \blx@getformat\cbx@postnote@prefix@fmt{ffd}{}{postnote:prefix}%
    \cbx@postnote@prefix@fmt{#1}}%
  \ifblank{#2}{}{%
    \blx@getformat\cbx@postnote@stem@fmt{ffd}{}{postnote:stem}%
    \cbx@postnote@stem@fmt{#2}}%
  }
\def\cbx@postnote@stem@fmt{}
\def\cbx@postnote@prefix@fmt{}
\makeatother

% 'editortype' in Klammern
\DeclareFieldFormat[commentary:editor,commentary:title]{editortype}{\mkbibparens{#1}}

% Doppelpunkt nach 'editortype'
\renewcommand*{\editortypedelim}{
  \ifboolexpr{
    test {\ifentrytype{commentary:editor}}
    or
    test {\ifentrytype{commentary:title}}
    }
    {}%
    {\addcomma\space}%
  }%

% Titel nicht kursiv
\DeclareFieldFormat[commentary:editor]{title}{\normalfont{#1}}
\DeclareFieldFormat[commentary:editor]{citetitle}{\normalfont{#1}}
\DeclareFieldFormat[commentary:editor]{maintitle}{\normalfont{#1}}


% Kursive Schrift für Bearbeiter von Kommentaren und "in: "
\DeclareFieldFormat[commentary:title,commentary:editor]{prenote}{\mkbibemph{#1}\addspace in \addcolon}%



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Mustertext
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}
\section*{Beispiele juristischer Kommentare}

\subsection*{Kommentare mit Zitierschema \texttt{commentator:mid}}
\cite[(Ellenberger)§ 134 Rn. 14]{palandt}.\footcite[(Ellenberger)§ 134 Rn. 14]{palandt}\\
\cite[(Armbrüster)§~138 Rn.~9]{muekobgb}.\footcite[(Armbrüster)§ 138 Rn. 9]{muekobgb} \\
\cite[(Hartmann)§ 287 Rn. 5]{blah}. \footcite[(Hartmann)§ 287 Rn. 5]{blah} \\
\cite[(Hartmann)§ 286 Rn. 13]{blah2}. \footcite[(Hartmann)§ 286 Rn. 13]{blah2}\\
\cite[(Bearbeiter)§ 1 KSchG Rn. 2]{erfk}.\footcite[(Bearbeiter)§ 1 KSchG Rn. 2]{erfk}\\

\subsection*{Kommentare mit Zitierschema \texttt{commentator:pre}}

\cite[Matusche-Beckmann][§ 3 Rn. 15]{hdbversr}.\footcite[Matusche-Beckmann][§ 3 Rn. 15]{hdbversr}\\
\cite[Mustermann][Art.~20 Rn.~3]{maunzduerig}.\footcite[Mustermann][Art. 20 Rn. 3]{maunzduerig}

\printbibliography[type=commentary:editor,title={Literatur (nur \texttt{commentary:editor})}]

\printbibliography[type=commentary:title,title={Literatur (nur \texttt{commentary:title})}]

\printbibliography

\end{document}
1

If you don't want to use author, editor other other names for sorting, you can issue the options useauthor=false, useditor=false, for those entries. In new versions of biblatex it is possible to do that on a per-type basis

\ExecuteBibliographyOptions[commentary:title]{useeditor=false}

Then you only need to make sure that the sorting scheme also takes into account maintitle, since you use that field extensively. The usual definition only takes sorttitle and title. A natural extension of the standard definition would be

\DeclareSortingTemplate{nty}{
  \sort{
    \field{presort}
  }
  \sort[final]{
    \field{sortkey}
  }
  \sort{
    \field{sortname}
    \field{author}
    \field{editor}
    \field{translator}
    \field{sorttitle}
    \field{maintitle}
    \field{title}
  }
  \sort{
    \field{sorttitle}
    \field{maintitle}
    \field{title}
  }
  \sort{
    \field{sortyear}
    \field{year}
  }
  \sort{
    \field{volume}
    \literal{0}
  }
}

In total

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}


\usepackage[%
  backend=biber,%
  sorting=nty,%
  sortcites=true,%
  maxnames=4,%
  minnames=4,%
  style=ext-authortitle-ibid,%
  articlein=false,%
  %innamebeforetitle=true,
  useprefix=true,%
  isbn=false,%
]{biblatex}
\usepackage[babel, german=quotes]{csquotes}

\ExecuteBibliographyOptions[commentary:title]{useeditor=false}

\DeclareSortingTemplate{nty}{
  \sort{
    \field{presort}
  }
  \sort[final]{
    \field{sortkey}
  }
  \sort{
    \field{sortname}
    \field{author}
    \field{editor}
    \field{translator}
    \field{sorttitle}
    \field{maintitle}
    \field{title}
  }
  \sort{
    \field{sorttitle}
    \field{maintitle}
    \field{title}
  }
  \sort{
    \field{sortyear}
    \field{year}
  }
  \sort{
    \field{volume}
    \literal{0}
  }
}


\renewcommand*{\mkbibnamefamily}[1]{%
  \ifboolexpr{%
    test {\ifentrytype{commentary:title}}%
    }%
  {#1}%
  {\mkbibemph{#1}}}

\renewcommand*{\mkbibnamegiven}[1]{%
  \ifboolexpr{
    test {\ifentrytype{commentary:title}}
    }%
  {#1}%
  {\mkbibemph{#1}}}

\renewcommand*{\mkbibnameprefix}[1]{%
  \ifboolexpr{
    test {\ifentrytype{commentary:title}}
    }%
  {#1}%
  {\mkbibemph{#1}}}

\renewcommand*{\mkbibnamesuffix}[1]{%
  \ifboolexpr{
    test {\ifentrytype{commentary:title}}
    }%
  {#1}%
  {\mkbibemph{#1}}}


%Im Literaturverzeichnis Doppelpunkt nach Namen, kein Punkt
\DeclareDelimFormat[bib]{nametitledelim}{\addcolon\space} 

%  Schrägstriche zwischen den Autoren 
\DeclareDelimFormat{multinamedelim}{\addslash}% 
\DeclareDelimAlias{finalnamedelim}{multinamedelim}%

% ebd. kursiv
\renewcommand*{\mkibid}{\mkbibemph}

% Keine Ausgabe des Verlags
\AtEveryCitekey{\clearlist{publisher}}
\AtEveryBibitem{\clearlist{publisher}}

% Keine Ausgabe des Ortes
%\AtEveryCitekey{\clearlist{location}}
%\AtEveryBibitem{\clearlist{location}}

% Namen sortiert als Nachname, Vorname
\DeclareNameAlias{sortname}{family-given}

% Kein Punkt am Ende des Eintrags im LitVZ
%\renewcommand{\finentrypunct}{}

% kein Punkt nach Addendum
\renewcommand*{\finentrypunct}{%
  \iffieldundef{addendum}%
    {\addperiod}%
    {}%
  }

% 'Auflage' statt 'Aufl.'
%\DefineBibliographyStrings{german}{%
%  edition = {\ifbibliography{Auflage}{Aufl\adddot}},%
%}%

% Erkennt Satzzeichen & setzt kein Komma ausser bei Abkurzungen
%\DefineBibliographyExtras{german}{\DeclarePunctuationPairs{comma}{*}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Definition von 'commentary'
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



\DeclareBibliographyDriver{commentary:editor}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{author/editor+others/translator+others}%
  \setunit{\printdelim{nametitledelim}}%
  \newblock
  \usebibmacro{maintitle+title}%
  \newunit\newblock
  \usebibmacro{byauthor}%
  \newunit\newblock
  \usebibmacro{byeditor+others}%
  \newunit\newblock
  \printfield{edition}%
  %\newunit
  %\usebibmacro{location+date}%
  \setunit*{\addcomma\space}%
  \printlist{location}%
  \setunit*{\space}%
  \usebibmacro{date}%
  \newunit\newblock
  \usebibmacro{addendum+pubstate}%
  \setunit{\bibpagerefpunct}%
  \newblock
  \usebibmacro{finentry}}

\DeclareBibliographyDriver{commentary:title}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{maintitle+title}% neu
  \newunit\newblock% neu
  \usebibmacro{author/editor+others/translator+others}%
  \setunit{\printdelim{nametitledelim}}%
  \newblock
  %\usebibmacro{maintitle+title}%
  %\newunit\newblock
  \usebibmacro{byauthor}%
  \newunit\newblock
  \usebibmacro{byeditor+others}%
  \newunit\newblock
  \printfield{edition}
  %\newunit
  %\usebibmacro{location+date}%
  \setunit*{\addcomma\space}%
  \printlist{location}%
  \setunit*{\space}%
  \usebibmacro{date}%
  \newunit\newblock
  \newunit\newblock
  \usebibmacro{addendum+pubstate}%
  \setunit{\bibpagerefpunct}%
  \newblock
  \usebibmacro{finentry}}

\let\oldpostnotedelim\postnotedelim
\renewcommand*{\postnotedelim}{%
  \ifboolexpr{
    test {\ifentrytype{commentary:editor}}
    or
    test {\ifentrytype{commentary:title}}
    }%
  {}%
  {\oldpostnotedelim}} 

\DeclareFieldFormat{postnote:stem}{\oldpostnotedelim\mkpageprefix[pagination][\mknormrange]{#1}}
\DeclareFieldFormat{postnote:prefix}{\addslash\mkbibemph{#1}}
\DeclareFieldFormat{postnote}{\mkpostnote{#1}}

\makeatletter
\newrobustcmd*{\mkpostnote}[1]{\mkpostnote@i#1&}

\def\mkpostnote@i{%
  \@ifnextchar(%)
    {\mkpostnote@ii}
    {\mkpostnote@ii()}}

\def\mkpostnote@ii(#1)#2&{%
  \ifblank{#1}{}{%
    \blx@getformat\cbx@postnote@prefix@fmt{ffd}{}{postnote:prefix}%
    \cbx@postnote@prefix@fmt{#1}}%
  \ifblank{#2}{}{%
    \blx@getformat\cbx@postnote@stem@fmt{ffd}{}{postnote:stem}%
    \cbx@postnote@stem@fmt{#2}}%
  }
\def\cbx@postnote@stem@fmt{}
\def\cbx@postnote@prefix@fmt{}
\makeatother

% 'editortype' in Klammern
\DeclareFieldFormat[commentary:editor,commentary:title]{editortype}{\mkbibparens{#1}}

% Doppelpunkt nach 'editortype'
\renewcommand*{\editortypedelim}{%
  \ifboolexpr{
    test {\ifentrytype{commentary:editor}}
    or
    test {\ifentrytype{commentary:title}}
    }
    {\addspace}%
    {\addcomma\space}%
  }%

% Titel nicht kursiv
\DeclareFieldFormat[commentary:editor]{title}{\normalfont{#1}}
\DeclareFieldFormat[commentary:editor]{citetitle}{\normalfont{#1}}
\DeclareFieldFormat[commentary:editor]{maintitle}{\normalfont{#1}}


% Kursive Schrift für Bearbeiter von Kommentaren und "in: "
\DeclareFieldFormat[commentary:title,commentary:editor]{prenote}{\mkbibemph{#1}\space\bibstring{in}\addcolon}%


\begin{filecontents}{\jobname.bib}
@COMMENTARY:EDITOR{palandt,
    editor = {Palandt, Otto},
    editortype = {founder},
    YEAR = {2019},
    TITLE = {Bürgerliches Gesetzbuch mit Nebengesetzen},
    EDITION = {79},
    ISBN = {978-3-406-73800-5},
    PUBLISHER = {C.H. Beck},
    ADDRESS = {München},
    shorthand = {Palandt},
    addendum   = {(zit. als Palandt/\emph{Bearbeiter})}
    %OPTIONS = {howcited},
}

@COMMENTARY:TITLE{muekobgb,
  maintitle  = {Münchener Kommentar zum Bürgerlichen Gesetzbuch},
  editor     = {Säcker, Franz},
  volume     = {1},
  title      = {Allgemeiner Teil},
  edition    = {7},
  address    = {München},
  year       = {2015},
  shorthand  = {MüKoBGB},
  addendum   = {(zit. als MüKoBGB/\emph{Bearbeiter})}
  %OPTIONS    = {howcited},
}

@COMMENTARY:TITLE{hdbversr,
  maintitle  = {Ver\-sicherungs\-rechts-Hand\-buch},
  editor     = {Beckmann, Roland Michael and Matusche-Beckmann, Annemarie},
  edition    = {3},
  address    = {München},
  year       = {2015},
  shorthand  = {VersRHdb},   
  %OPTIONS    = {howcited},
  addendum = {(zit. als \emph{Bearbeiter} in: VersRHdb)},
}

@COMMENTARY:EDITOR{maunzduerig,
  maintitle  = {Grundgesetz},
  editor     = {Maunz,  Theodor  and  Dürig,  Günter},
  editortype = {founder},
  edition    = {80. Erg.-Lfrg., Juni 2017},
  address    = {München},
  %year       = {2015},
  shorthand  = {Maunz/Dürig},   
  %OPTIONS    = {howcited},
  addendum = {(zit. als \emph{Bearbeiter} in: Maunz/Dürig)},  
}

@COMMENTARY:TITLE{erfk,
  maintitle  = {Erfurter Kommentar zum Arbeitsrecht},
  editor     = {Müller-Glöge, Rudi and Preis, Ulrich and Schmidt, Ingrid},
  edition    = {16},
  address    = {München},
  year       = {2016},
  shorthand  = {ErfK},
  addendum   = {(zit. als ErfK/\emph{Bearbeiter})}
  %OPTIONS    = {howcited},
}

@COMMENTARY:TITLE{blah,
  maintitle  = {Zivilprozessordnung. Mit FamFG, GVG und anderen Nebengesetzen},
  editor     = {Baumbach, Adolf and Lauterbach, Wolfgang and Albers, Jan and Hartmann, Peter},
  edition    = {74},
  address    = {München},
  year       = {2016},
  shorthand  = {BLAH},
  addendum   = {(zit. als BLAH/\emph{Bearbeiter})}
  %OPTIONS    = {howcited},
}

@COMMENTARY:TITLE{blah2,
  maintitle  = {Zivilprozessordnung mit verschiedenen Editor-Typen},
  editor     = {Baumbach, Adolf},
  editortype = {founder},
  editora    = {Lauterbach, Wolfgang}, 
  editoratype = {continuator},
  editorb    = {Albers, Jan and Hartmann, Peter},
  editorbtype = {editor},
  edition    = {74},
  address    = {München},
  year       = {2016},
  shorthand  = {BLAH2},
  addendum   = {(zit. als BLAH2/\emph{Bearbeiter})}
  %OPTIONS    = {howcited},
}

@COMMENTARY:TITLE{staudinger,
  maintitle  = {Kommentar zum Bürgerlichen Gesetzbuch},
  editor     = {Staudinger, J. von},
  editortype = {founder},

}
\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}
\section*{Beispiele juristischer Kommentare}

\subsection*{Kommentare mit Zitierschema \texttt{commentator:mid}}
\cite[(Ellenberger)§ 134 Rn. 14]{palandt}.\footcite[(Ellenberger)§ 134 Rn. 14]{palandt}\\
\cite[(Armbrüster)§~138 Rn.~9]{muekobgb}.\footcite[(Armbrüster)§ 138 Rn. 9]{muekobgb} \\
\cite[(Hartmann)§ 287 Rn. 5]{blah}. \footcite[(Hartmann)§ 287 Rn. 5]{blah} \\
\cite[(Hartmann)§ 286 Rn. 13]{blah2}. \footcite[(Hartmann)§ 286 Rn. 13]{blah2}\\
\cite[(Bearbeiter)§ 1 KSchG Rn. 2]{erfk}.\footcite[(Bearbeiter)§ 1 KSchG Rn. 2]{erfk}\\

\subsection*{Kommentare mit Zitierschema \texttt{commentator:pre}}

\cite[Matusche-Beckmann][§ 3 Rn. 15]{hdbversr}.\footcite[Matusche-Beckmann][§ 3 Rn. 15]{hdbversr}\\
\cite[Mustermann][Art.~20 Rn.~3]{maunzduerig}.\footcite[Mustermann][Art. 20 Rn. 3]{maunzduerig}

\printbibliography[type=commentary:editor,title={Literatur (nur \texttt{commentary:editor})}]

\printbibliography[type=commentary:title,title={Literatur (nur \texttt{commentary:title})}]

\printbibliography

\end{document}

I changed a few small things that caught my eye, but I didn't go through all of the code.

The redefinitions of \mkbibnamefamily did what they were supposed to do, but I would still recommend the slightly more standard way of writing them that I used here.

In theory

\ifboolexpr{%
  test {\ifentrytype{commentary:title}}%
}%

could of course be replaced by

\ifentrytype{commentary:title}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.