I have a simple snippet that lists resources as an unordered list:
$sql ="SELECT id, longtitle, alias FROM `modx_site_content`;";
$result = mysql_query($sql);
while ($row = mysql_fetch_assoc($result)) {
$output .= '<li><a href="index?q=' . $row['id'] . '">' . $row['longtitle'] . '</a></li>';
}
The resultant link(s) work fine
mysite.com/index?q=12 but I was hoping it would automatically be parsed as a Friendly URL's to match the rest of the site. If I'm just listing the resources in just one folder I can use the 'alias' and hand-code the directory but that doesn't work for more than one folder.
Is there a way of automatically converting the output to the 'Friendly URL' equivalent within the snippet?
[ed. note: randall last edited this post 15 years, 2 months ago.]