I would suggest to simply use the built-in sectioning macros for the slides.
With \definehead
you can create new sectioning commands which can be
individually styled and the behaviour modified as desired. If you use MkIV
sectioning style you can provide a second argument which can be accessed with
\structureuservariable{…}
. Here is a very simple slide template
demonstrating that feature.
\useMPlibrary [dum] %% only for the screenshot
\setuppapersize [S6]
\setupbodyfont [sans,18pt]
\setupheadertexts [{\getmarking [slide] — \getmarking [subtitle]}]
\setupheader [style=bigbodyfont]
\definemarking [subtitle]
\setuplayout
[height=.8\paperheight,
width=middle,
topspace=.15\paperwidth]
\definehead
[slide] [subsection]
[page=yes, placehead=empty,insidesection=\doSubtitle]
\starttexdefinition doSubtitle
\marking [subtitle] {\structureuservariable{subtitle}}
\stoptexdefinition
\starttext
\startslide [title=Foo] [subtitle=a subtitle]
\input ward
\stopslide
\startslide [title=Bar] [subtitle=another subtitle]
\placesidebyside
{\externalfigure [dummy] [width=.5\textwidth]}
{\externalfigure [dummy] [width=.5\textwidth]}
\stopslide
\stoptext
Also have a look at Aditya's step-by-step instruction tutorial to create
slides with ConTeXt.
To actually answer your question: You can create commands with arguments using
\dosingleempty
for one argument \dodoubleempty
for two arguments, etc.
Here is an example of a macro \TwoArgs
that simply prints parentheses around
the arguments.
\def\TwoArgs
{\dodoubleempty\doTwoArgs}
\def\doTwoArgs[#1][#2]%%
{(#1) (#2)}
More information on the wiki - Commands with optional arguments