<div id="module_<?php echo($module_instance_id); ?>" class="module content-list-module content-list-alphabetical <?php echo($module_class); ?>">
	<?php
	if($title && $title_heading_level)
	{
		?><<?php echo($title_heading_level); ?> class="module-title"><?php echo($title); ?></<?php echo($title_heading_level); ?>><?php
	}
	?>
	<div class="row">
		<?php
		$last_letter = "";
		$open = false;

		if($num_columns == 1)
		{
			$class = "col-12";
		}
		else if($num_columns == 2)
		{
			$class = TWO_COL;
		}
		else if($num_columns == 3)
		{
			$class = THREE_COL;
		}
		else if($num_columns == 4)
		{
			$class = TWO_COL . " col-lg-3";
		}
		else 	// failsafe
		{
			$class = "col-12";
		}

		foreach($pages as $p)
		{
			$letter = substr($p->title, 0, 1);

			// Non A-Z will be classified as #
			if(preg_match('/[A-Za-z]/', $letter) == false)
			{
				$letter = "#";
			}

			if($last_letter != $letter)
			{
				if($open)
				{
					?></ul></fieldset></div><?php
				}
				$open = true;
				?><div class="<?php echo($class); ?>"><fieldset><legend><?php echo($letter); ?></legend><ul><?php
			}
			$link = ($p->url_override ? $p->url_override : "/" . $p->url);
			?><li><a href="<?php echo($link); ?>"><?php echo($p->title); ?></a></li><?php
			$last_letter = $letter;
		}

		if($open)
		{
			?></ul></fieldset></div><?php
		}
		?>
	</div>
</div>
