I use labels before entries in the bibliography, just as in the solution given in Bibliography styles like authordate2 in biblatex or natbib?, which works like a charm. However, I need to limit the labels to just the first part of the bibliography (being the second dedicated to online sources without author) which I manage with filters as per MWE. I'm using biblatex, biber, APA style, italian. I edit on Sharelatex.com.
\documentclass{book}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[italian]{babel}
\usepackage[babel]{csquotes}
\usepackage[style=apa,backend=biber]{biblatex}
\DeclareLanguageMapping{italian}{italian-apa}
%LABELS
\defbibenvironment{bibliography}
{\list
{
\printtext[]{%
\begingroup
\defcounter{maxnames}{\value{mymaxcitenames}}%
\printnames{labelname}%
\setunit{\nameyeardelim}%
\printfield{labelyear}%
\printfield{extrayear}%
\endgroup
}%
}
{\setlength{\labelwidth}{100pt}%
\setlength{\leftmargin}{\labelwidth}%
\setlength{\labelsep}{\biblabelsep}%
\addtolength{\leftmargin}{\labelsep}%
\setlength{\itemsep}{\bibitemsep}%
\setlength{\parsep}{\bibparsep}}%
\renewcommand*{\makelabel}[1]{\hfill##1\hss}
}
{\endlist}
{\item}
\defbibfilter{online}{
type=online
}
\defbibfilter{offline}{
type=book or
type=article or
type=report
}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@online{cit1,
title = {Title},
url = {http://www.website.com},
timestamp = {2013-04-11T17:20:44Z},
titleaddon = {Example},
urldate = {2013-04-10},
date = {2004}
}
@report{cit2,
author = {BBBAuthor, Name},
title = {Title Title Title},
url = {http://www.example.com},
timestamp = {2013-04-11T17:20:44Z},
titleaddon = {Website Name},
urldate = {2013-04-10},
date = {2004}
}
@book{cit3,
location = {Location},
title = {Title Title},
timestamp = {2016-02-01T21:50:03Z},
langid = {english},
publisher = {Publisher},
author = {Author, Name},
date = {2001}
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\begin{minipage}{\textwidth}
Bla bla\footnote{\cite[]{cit1}, \url{http://www.website.com}}.
Bla\footnote{\cite[]{cit2}, \url{http://www.example.com}}.
Blaaa blaa bla\footcite[]{cit3}.
\printbibliography[heading=bibintoc,filter=offline,title={Bibliography}]
\printbibliography[title={Online},filter=online,heading=subbibliography]
\end{minipage}
\end{document}
mymaxcitenamesnot being defined, the MWE is missing\newcounter{mymaxcitenames} \AtBeginDocument{% \setcounter{mymaxcitenames}{\value{maxnames}}% }from the answer you linked to. See also Author and year displayed in separate column: which bibliography style is this? and Adding an AuthorYear block at the beginning of bibliography entries – moewe Feb 17 '16 at 09:03