I'm creating a beamerposter style accordingly to my department specification. I would like to create a theme where the definitions of the blocks can vary accordingly to a keyword in the calling of the theme. I'm trying to explain with a MWE The custom style works like this
\ProvidesPackage{beamerthemeMYposter} % this style was created by David Vilar
% Define boolean options
% -----------------
\newif\if@shadowbox
\DeclareOption{shadowbox}{\@shadowboxtrue}
\DeclareOption*{\PackageWarning{beamerthemeMYposter}{Unknown option `\CurrentOption'}}
% process options
% ------------
\ProcessOptions
\mode<presentation>
\usepackage{tikz} % for drawing the nice rounded boxes
\usetikzlibrary{arrows,backgrounds}
\newcommand{\makeruleinbox}{{\usebeamercolor[bg]{block alerted title}\centering\hspace*{-0.7cm}\rule{\inboxrule}{0.5cm}}}
\usepackage{ragged2e}
\newlength{\inboxwd}
\newlength{\iinboxwd}
\newlength{\inboxrule}
\makeatletter
\makeatother
\usepackage{xcolor}
% Block definition
\setbeamercolor*{block body}{fg=blue,bg=white}
\setbeamerfont{block title}{size=\large,series=\bf}
% conditional block body definition
\if@shadowbox
\setbeamercolor*{block title}{bg=white,fg=red}
\setbeamercolor*{block body}{fg=blue, bg=white}
\setbeamerfont{block title}{size=\large,series=\bf}
\setbeamertemplate{block begin}
{
\par\vskip\medskipamount
\begin{beamercolorbox}[colsep*=.5ex,dp={2ex},center]{block title}
\vskip-0.25cm
\usebeamerfont{block title}\large\insertblocktitle
\begin{flushleft}
\vskip-1cm
\begin{tikzpicture}[remember picture,overlay]
\shade [inner color=blue,outer color=white]
(0,0) rectangle (\textwidth,0.3cm);
\end{tikzpicture}
\end{flushleft}
\end{beamercolorbox}
{\parskip0pt\par}
\ifbeamercolorempty[bg]{block title}
{}
{\ifbeamercolorempty[bg]{block body}{}{\nointerlineskip\vskip-0.5pt}}
\usebeamerfont{block body}
\vskip-0.5cm
\begin{beamercolorbox}[colsep*=.5ex,vmode]{block body}
\justifying
}
\setbeamertemplate{block end}
{
\end{beamercolorbox}
\vskip\smallskipamount
}
\else
\setbeamercolor*{block title}{bg=blue,fg=white}
\setbeamertemplate{block begin}{
\vskip.75ex
\begin{beamercolorbox}[leftskip=1cm,colsep*=.75ex]{block title}%
\usebeamerfont*{block title}\insertblocktitle
\end{beamercolorbox}%
{\ifbeamercolorempty[bg]{block body}{}{\nointerlineskip\vskip-0.5pt}}%
\usebeamerfont{block body}%
\begin{beamercolorbox}[colsep*=.75ex,sep=.75ex,vmode]{block body}%
\ifbeamercolorempty[bg]{block body}{\vskip-.25ex}{\vskip-.75ex}\vbox{}%
}
\setbeamertemplate{block end}{
\end{beamercolorbox}
}
\fi
\mode<all>
Then in the document I'm trying to call like that
\documentclass[final]{beamer}
\mode<presentation> {
\usepackage[size=a0,orientation=landscape,debug]{beamerposter} % e.g. custom size poster
\usetheme[shadowbox]{MYposter}
}
\begin{document}
\begin{frame}{}
\begin{block}{trial}
\end{block}
\end{frame}
\end{document}
If you try this MWE you can see that there is no way the option shadowbox is considered. I must admit this is my first attempt to use conditional keyword in package creation. Any suggestion is welcomed