Quote from: Mark at Nov 16, 2005, 04:06 PM
If a tv is left blank then the output will be bank. But, I’m assuming you are talking about hiding more than the just the tv. So here is an example (not using the API):
$tbl = $modx->getFullTableName('site_tmplvar_contentvalues');
$id = $modx->documentObject['id'];
$tv = $modx->db->getValue('SELECT `value` FROM '.$tbl.' WHERE `tmplvarid` = IDOFTEMPLATE VARIABLE AND `contentid` = '.$id .'');
What is the IDOFTEMPLATE VARIABLE did in MySql syntax? Never heard that kinda syntax yet.
As far as I understand, the getFullTableName will append the right prefix to the table name, right? Same thing with documentObject, but where should I use this code? I mean, is it snippets or what? I’m really new, but I’m interested in learning more.
If I setup a TV to a template, can I use snippet to access the TV, like the one shown in the quote? Is it possible to modify it and apply some logic come up with something, instead of using widget? Or is it hard and possible to make a widget?
Thanks in advance for every reply.
Sincerely,
Wendy Novianto