First you have to make a distinction between the values which
are set with the first and second argument of \startchapter,
\startsection etc. While the first argument takes only certain
keys, e.g. title, bookmark etc. you’re free to choose your own
keys for the second argument because they are considered
userdata. The point of this userdata is to give users a way to
specify information which are printed in the table of content or
in the header, to access these values context provides two
commands. When you create a new layout for the table of
contents you can use the \structurelistuservariable command
which takes the name of the key with the information as argument
and when you create a new header layout you can use the
\structureuservariable command.
\define[3]\ChapterListCommand
{\starttabulate
\NC Number \NC #1 \NC\NR
\NC Title \NC #2 \NC\NR
\NC Page \NC #3 \NC\NR
\TB[medium]
\NC File \NC \structurelistuservariable{file} \NC\NR
\stoptabulate}
\setuplist[chapter][alternative=command,command=\ChapterListCommand]
\define[2]\ChapterHeadCommand
{\startframed[align=flushleft,strut=no]
\starttabulate[before=,after=]
\NC Number \NC #1 \NC\NR
\NC Title \NC #2 \NC\NR
\TB[medium]
\NC File \NC \structureuservariable{file} \NC\NR
\stoptabulate
\stopframed}
\setuphead[chapter][command=\ChapterHeadCommand]
\starttext
\completecontent
\startchapter[title=Knuth example][file=knuth.tex]
\input knuth
\stopchapter
\startchapter[title=Zapf example][file=zapf.tex]
\input zapf
\stopchapter
\stoptext
Wolfgang