Hi,
Is it possible to dynalically create TVs in a snippet? For e.g I have the following code in a snippet:
if (condition) {
$tvs = $modx->newObject(modTemplateVar);
$tvs->set('name'=>'newTemplate');
/*more settings*/
$tvs->save();
}
I know I may need to assign it to a template and set few more porperties but in theory is it possible to do this? I have been searching about it in the forums about creating new objects via newObject method but couldn't find one about template variables.
Any help would be much appreciated. Thanks!