<commit_before><?php 
defined('C5_EXECUTE') or die("Access Denied.");
$th = Loader::helper('text');
//Note that $nh (navigation helper) is already loaded for us by the controller (for legacy reasons)
?>

<div class="ccm-page-list-typeahead">
  <form>
    <input type="text" name="selected_option" class="typeahead" placeholder="Find a Walk" autocomplete="off" />
    <input type="submit" value="Go" />
  <ul>
	<?php 
	 uasort($pages, function($a,$b) {$ap = $a->getCollectionParentID();$bp = $b->getCollectionParentID();return ($ap == $bp) ? 0 : strcmp(Page::getByID($ap)->getCollectionName(), Page::getByID($bp)->getCollectionName());});
   $lastParent = "";
	 foreach ($pages as $page):
    $parent = Page::getByID($page->getCollectionParentID())->getCollectionName();
    if($lastParent != $parent) {
      if($lastParent != "") { echo '</ul></li>'; }
      echo t("<li class='parent'>$parent<ul>");<commit_msg>Sort the typeahead alphabetically by default<commit_after><?php 
defined('C5_EXECUTE') or die("Access Denied.");
$th = Loader::helper('text');
//Note that $nh (navigation helper) is already loaded for us by the controller (for legacy reasons)
?>

<div class="ccm-page-list-typeahead">
  <form>
    <input type="text" name="selected_option" class="typeahead" placeholder="Find a Walk" autocomplete="off" />
    <input type="submit" value="Go" />
  <ul>
	<?php 
	 uasort($pages, function($a,$b) {$ap = $a->getCollectionParentID();$bp = $b->getCollectionParentID();return ($ap == $bp) ? strcmp($a->getCollectionName(), $b->getCollectionName()) : strcmp(Page::getByID($ap)->getCollectionName(), Page::getByID($bp)->getCollectionName());});
   $lastParent = "";
	 foreach ($pages as $page):
    $parent = Page::getByID($page->getCollectionParentID())->getCollectionName();
    if($lastParent != $parent) {
      if($lastParent != "") { echo '</ul></li>'; }
      echo t("<li class='parent'>$parent<ul>");
{'fraction_non_alphanumeric': 0.21182008368200836, 'fraction_numerical': 0.0015690376569037657, 'mean_word_length': 5.619377162629758, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3945117', 'n_tokens_mistral': 618, 'n_tokens_neox': 605, 'n_words': 133}