I must have been doing something wrong somewhere as now a simple function like..
Code:
public function getWidth()
{
return \XLite\Core\Config::getInstance()->Tienda->myWidget->data_width;
}
with
Code:
{if:getWidth()}width="{getWidth()}"{end:}
in the template is working perfectly.
If the option is left blank in the module settings then the whole line isn't shown.
I thought I might need something a little more complex like
Code:
public function getWidth()
{
$dataWidth = \XLite\Core\Config::getInstance()->Tienda->myWidget->data_width;
return !empty($dataWidth) ? $dataWidth : false;
}
but it doesn't seem necessary.