First off ...
@s4n
we have a Dev namespace, so why are we not using that?
Secondly ...
@hushutup
You are trying to implement something fairly complex using several properties and functions (e.g., debugging your #switch function is only one small piece ... there seems to be a redundant pipe at the end). As I stated previously, it is much, much, much simpler to begin with something very, very simple and build upon that.
First, clearly define your ultimate goal and what you want the SMW structure to accomplish. This will help us to determine first if what you want to do is even feasible, and it will allow us to help more if we see where you are trying to go.
Consistent with what you envision, pick one property that you want to actually use. Then create a stupid-simple template that uses that property (nothing fancy, just a very simple template). Then create a stupid-simple form to feed that template. Then you verify that it works and debug as necessary (which will be pretty easy and instructive). This sets up the base structure you will be working with ... Property page, Template page, Form page. Then begin adding in components one at a time, debugging each in turn before adding another layer of complexity. (components = any changes made by adding in elements like parserfunctions, new properties/fields, styles, etc.)
The way you seem to be going about it is by scavenging examples that you think apply to what you are trying to accomplish (which is not all that clear yet and why I mentioned that it would be helpful if you corrected your template to conform to standards ... which in turn may not be applicable, since it is a SMW template). Nevertheless, I think you are trying to jump into calculus before learning anything about algebra and trigonometry.
Start small and build up, debugging along the way. You will learn loads of things this way, and the help you will require will be more easily framed and addressed ... and you will require less help I think. The process takes time though, but if you are willing, we need more SMW developers.
EDIT:
RE you last post: You are getting back exactly what you asked for ... a link and a title (with an extra square bracket, bc you have one too many on the outside).