# chapter style with lateral bar

Is is possible to have a different text/layout for the chapter page, and a vertical bar? What I want to achieve is something like this:

Using tikz is probably overkill here, but works. The following code must be compiled twice for the vertical rule to be correctly drawn.

\documentclass[twoside]{book}

\usepackage{tikz}
\usepackage{tikzpagenodes}
\usepackage{titlesec}
\usepackage{lipsum}

\titleformat{\chapter}[display]%
{\normalfont\Huge\filright}%
{\thechapter}%
{25pt}
{\tikz[remember picture,overlay]
\draw ([xshift=-30pt]current page text area.north west)
-- ([xshift=-30pt]current page text area.south west);}

\begin{document}
\chapter{Foobar}
\lipsum
\end{document}