Can Widgets Include ParserFunctions
Fragment of a discussion from Extension talk:Widgets
Widgets themselves can have if/else statements coded using Smarty.
It makes sense to combine them with Templates if you want to insert a site-wide API key or display the widget with predefined parameters, but allow users enter one of them (e.g. YouTube video ID or Twitter search query).
Glad it works for you now - enjoy!
Sergey