MWE
\documentclass[a4paper,twoside,openright,10pt]{book}
\usepackage{color}
\usepackage{tikz}
\usetikzlibrary{positioning}
\usepackage[explicit]{titlesec}
\usepackage{ifoddpage}
\usepackage{lipsum}
\usepackage{caption}
\usepackage{graphicx}
\usepackage{captdef}
\usepackage{ifoddpage}
\usepackage{ifthen}
\usepackage{calc}
\usepackage{titlesec}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand*{\blankpage}{%
\vspace*{\fill}
{\centering\textit{This page is left blank.}}
\vspace{\fill}}
\makeatletter
\renewcommand*{\cleardoublepage}{\clearpage\if@twoside \ifodd\c@page\else
\blankpage
\thispagestyle{empty}
\newpage
\if@twocolumn\hbox{}\newpage\fi\fi\fi}
\makeatother
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand*{\imagepage}[1]{%
\vspace*{\fill}
{\centering\includegraphics[width=10cm]{#1}}
\vspace{\fill}}
\makeatletter
\renewcommand*{\cleardoublepage}{\clearpage\if@twoside \ifodd\c@page\else
\blankpage
\thispagestyle{empty}
\newpage
\if@twocolumn\hbox{}\newpage\fi\fi\fi}
\makeatother
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{eso-pic}
\usepackage[scale=1,angle=0,opacity=1,contents={}]{background}
\usetikzlibrary{calc}
% auxiliary counter
\newcounter{chapshift}
\addtocounter{chapshift}{-1}
% the list of colors to be used (add more if needed)
\newcommand\BoxColor{%
\ifcase\thechapshift orange!30 \or green!30 \or yellow!30 \or red!30\or blue!30\or olive!30\or magenta!30\or red!30\else yellow!30\fi}
% the main command; the mandatory argument sets the color of the vertical box
\newcommand\ChapFrame{%
\AddEverypageHook{%
\ifodd\value{page}
\backgroundsetup{contents={%
\begin{tikzpicture}[overlay,remember picture]
\node[
fill=\BoxColor,
inner sep=0pt,
rectangle,
text width=1.2cm,
text height=5.8cm,
align=center,
anchor=north east
] %
at ($ (current page.north east) + (2mm,-4.7*\thechapshift cm) $)
{\rotatebox{90}{\hspace*{.3cm}\parbox[c][1cm][t]{5.5cm}{%
\raggedright\textcolor{black}{\footnotesize \scshape\leftmark}}}};
\end{tikzpicture}%
}%
}
\else
\backgroundsetup{contents={%
\begin{tikzpicture}[overlay,remember picture]
\node[
fill=\BoxColor,
inner sep=0pt,
rectangle,
text width=1.2cm,
text height=5.8cm,
align=center,
anchor=north west
]
at ($ (current page.north west) + (0mm,-4.7*\thechapshift cm) $)
{\rotatebox{90}{\hspace*{.3cm}\parbox[c][.8cm][t]{5.5cm}{%
\raggedright\textcolor{black}{\footnotesize \scshape\leftmark}}}};
\end{tikzpicture}%
}%
}
\fi
\BgMaterial}%
\stepcounter{chapshift}%
}
% redefinition of \chaptermark to contain only the title
\renewcommand\chaptermark[1]{\markboth{\thechapter.~#1}{}}
\begin{document}
\tableofcontents
\chapter{Chapter One}
\ChapFrame
\lipsum[1-15] % This page is left blank.
\chapter{Chapter Two}
\ChapFrame
\lipsum[1-15]
\imagepage{example-image-a} % For some even pages
\chapter*{Index}
\ChapFrame % <---
\addcontentsline{toc}{chapter}{Index}
\end{document}
When the new chapter coincides with the even numbered page; it writes a "This page is left blank." on this page and assigns the chapter to the next odd-numbered page. I want to add images to some of these pages instead of writing "This page is left blank.". I can't delete a \ChapFrame information and page number.
I want to assign a custom \ChapFrame macro to pages like Index page. Since the section is starred, \Chapframe takes the name of the previous section. Actually, I want the star section to have the name.
Are they possible?
Related to: 1) https://tex.stackexchange.com/a/48648/33075
Related to: 2) https://tex.stackexchange.com/a/167935/33075

