Beamer theme definition: redefine footer for certain frames

How do I remove / change the footer at certain slides in my theme .sty file?
I basically want to avoid using \setbeamertemplate{footline}{} in my .tex. E.g. on the title slide / toc / section slide...

Failed attempts

Using \newif

\newif\ifbeamer@test@title
\beamer@test@titlefalse

\defbeamertemplate*{title page}{test}{
\beamer@test@titletrue
<...>
\beamer@test@titlefalse
}

\defbeamertemplate*{footline}{test}{
\ifbeamer@test@title
\else
<...>
\fi
}


Minimal Working Example

Here a reduced MWE only considering the title page, however the solution should be general enough such that it can also be used for the table of content / section slides

cat beamerthemetest.sty

\mode<presentation>
%% goes to inner theme
\defbeamertemplate*{title page}{test}
{
\beamer@test@titletrue
{
\vspace{42pt}
\begin{beamercolorbox}{title}
\usebeamerfont{title}\inserttitle
\ifx\insertsubtitle\@empty
\else
\par\usebeamerfont{subtitle}\insertsubtitle
\fi
\end{beamercolorbox}
\begin{beamercolorbox}{author}
\usebeamerfont{author}\insertauthor
\end{beamercolorbox}
}
\beamer@test@titlefalse
}

%% goes to outer theme

\defbeamertemplate*{footline}{test}
{
\begin{beamercolorbox}[wd=\paperwidth, dp=1mm, ht=3.5mm
, leftskip=1mm, rightskip=1mm
]{footline}%

\makebox[240pt][l]{
\fi
}
\end{beamercolorbox}%
}

\mode<all>



with the test.tex

\documentclass[aspectratio=169]{beamer}
\usetheme{test}
\author{whoami}
\title{title}

\begin{document}
\maketitle

\section{abc}
\begin{frame}{abc}
cde
\end{frame}
\end{document}

• Aren't you simply looking for \begin{frame}[plain] or I missed something ? – BambOo May 7 '20 at 19:47
• That is a possibility however I would like this to happen automatically and solved at the .sty file level. It should also work for e.g. \frame{\sectionpage}. – Stefan May 9 '20 at 10:54
• Well you could have \setbeamertemplate{footline}{} <content> \setbeamertemplate{footline}{theme} for some specific content to disable the footline locally. This should work either in the .sty or the .tex – BambOo May 9 '20 at 11:48
• I defined an optional footline in the .sty, however I can only set this template in the .tex file. It seems to be ignored when putting it in the first line of the defined titlepage template. – Stefan May 11 '20 at 13:47
• Moreover, the defined if seem to be ignored. Any ideas why? – Stefan May 11 '20 at 14:20

This seems to work, I am not convinced this is the best approach though.

The .tex

\documentclass[aspectratio=169]{beamer}
\usetheme{test}
\author{whoami}
\title{title}

\begin{document}

\newmaketitle

\section{abc}
\begin{frame}{abc}
cde
\end{frame}
\section{def}
\begin{frame}{def}
fgf
\end{frame}
\end{document}


The .sty

\mode<presentation>
%% goes to inner theme
\defbeamertemplate*{title page}{test}
{
%\beamer@test@titletrue
{
\vspace{42pt}
\begin{beamercolorbox}{title}
\usebeamerfont{title}\inserttitle
\ifx\insertsubtitle\@empty
\else
\par\usebeamerfont{subtitle}\insertsubtitle
\fi
\end{beamercolorbox}
\begin{beamercolorbox}{author}
\usebeamerfont{author}\insertauthor
\end{beamercolorbox}
}
}

\newcommand{\newmaketitle}{
\setbeamertemplate{footline}[default]
\begin{frame}
\maketitle
\end{frame}
\setbeamertemplate{footline}[test]
}

%% goes to outer theme

\defbeamertemplate*{footline}{test}
{
\begin{beamercolorbox}[wd=\paperwidth, dp=1mm, ht=3.5mm
, leftskip=1mm, rightskip=1mm
]{footline}%

\makebox[240pt][l]{
\fi
}
\end{beamercolorbox}%
}

\AtBeginSection[]
{
\setbeamertemplate{footline}[default]