Skip to content

Instantly share code, notes, and snippets.

@Cipa
Created September 1, 2011 12:33
Show Gist options
  • Save Cipa/1186074 to your computer and use it in GitHub Desktop.
Save Cipa/1186074 to your computer and use it in GitHub Desktop.
MODX Evolution - Get labels and values for checkbox, radio and select TVs
$elements = $modx->db->getValue($modx->db->select("elements", $modx->getFullTableName('site_tmplvars'), "id=" . $tvId));
$aElements = explode('||', $elements);
foreach($aElements as $e){
$ee = explode('==', $e);
$output.='<a href="#" id="category-'.$ee[1].'">'.$ee[0].'</a>';
}
$elements = $modx->db->getValue($modx->db->select("elements", $modx->getFullTableName('site_tmplvars'), "id=" . $tvId));
$aElements = explode('||', $elements);
foreach($aElements as $e){
$ee = explode('==', $e);
$output.='<a href="#" id="category-'.$ee[1].'">'.$ee[0].'</a>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment