This TAL pattern produces "X" or "X, and Y" or "X, Y, and Z" etc:
<!-- (suppress whitespace) --><tal:loop repeat="item view/items"><!-- (suppress whitespace) --><tal:comma condition="repeat/item/index">, <tal:and condition="repeat/item/end"> and </tal:end> </tal:comma>
Item text<!-- (suppress whitespace) --></tal:loop>
That's not ideal for the X/Y case if the text for X is brief and simple, because there will be a comma for that case. It does work well for more complex X though.
This TAL pattern produces "X" or "X, and Y" or "X, Y, and Z" etc:
<!-- (suppress whitespace) "repeat/ item/index" >, "repeat/ item/end" > and </tal:end>
--><tal:loop repeat="item view/items"><!-- (suppress whitespace)
--><tal:comma condition=
<tal:and condition=
</tal:comma>
Item text<!-- (suppress whitespace)
--></tal:loop>
That's not ideal for the X/Y case if the text for X is brief and simple, because there will be a comma for that case. It does work well for more complex X though.