public function meta_box_template($post)
        {
            $articleTemplate = get_post_meta($post->ID, DPSFA_Article_Slug . "_template", true);
            $TemplateService = new Templates();
            $templates = $TemplateService->get_templates();
            ?>
		    <p>
		        <label for="my_meta_box_select">Template</label>
		        <select name="<?php 
            echo DPSFA_Article_Slug . "_template";
            ?>
" id="<?php 
            echo DPSFA_Article_Slug . "template";
            ?>
">
		            <?php 
            foreach ($templates as $template) {
                ?>
		            <option value="<?php 
                echo $template['path'];
                ?>
" <?php 
                selected($articleTemplate, $template['path']);
                ?>
>
		            	<?php 
                echo $template['type'];
                ?>
: <?php 
                echo $template['name'];
                ?>
		            </option>
		            <?php 
            }
            ?>
		        </select>
		        <?php 
            wp_nonce_field('article_meta_template', 'article_meta_template');
            ?>
		    </p>
		    <?php 
        }
 public function update_templates()
 {
     $Templates = new Templates();
     $this->templates = $Templates->get_templates();
 }
 public function template_override($template)
 {
     global $post;
     if ($post->post_type == DPSFA_Article_Slug) {
         // If post type is article
         $article = new Article(array('id' => $post->ID));
         if (file_exists($article->template)) {
             return $article->template;
         } else {
             $Template = new Templates();
             $templates = $Template->get_templates();
             if (empty($templates) || !file_exists($templates[0]['path'])) {
                 die("There are no valid templates available.");
             } else {
                 return $templates[0]['path'];
             }
         }
     }
     return $template;
 }