\doifassignmentelse {...} {then ...} {else ...}
</texcode>
=== \doiftext, \doiftextelse ==
See https://www.mail-archive.com/ntg-context@ntg.nl/msg73506.html for details.
\define\CustomHeader{%
\cap{\ss{\| %
\doiftextelse{\getmarking[chapter]}%
{\getmarking[chapter]}%
{Contents}%
}}
}
\setupheadertexts[\CustomHeader{}][][][\CustomHeader{}]