I have this snippet as an example:
<?php
$pageid = $modx->documentObject['id'];
$table = "ch_site_content";
$tableVars = "ch_site_tmplvar_contentvalues";
echo'<div id="navigation">
<ul>
';
$sql = "Select * from $table where parent = 0 and published = 1 and deleted != 1 and hidemenu = 0 order by menuindex asc";
$result = $modx->db->query($sql);
while($row = $modx->db->getRow( $result ) )
{
if($row['id'] == $pageid)
echo'<li class="navigationselected"><a href="[~'.$row['id'].'~]">'.$row['pagetitle'].'</a></li>';
else
echo'<li><a href="[~'.$row['id'].'~]">'.$row['pagetitle'].'</a></li>';
}
echo'</ul>
</div>
';
?>
Notice where there is $row[’pagetitle’], how can i make it output the pagetitle of the language the user in the site is currently viewing and not the pagetitle of the default doc?