HawtDogFlvrwtr Posted July 18, 2012 Share Posted July 18, 2012 Is there a way to create a dropdown list of the templates like it appears under genereral settings in the admin interface? I'm working on a module that I need to get that same exact list for, for configuration purposes. Thanks, Chris 0 Quote Link to comment Share on other sites More sharing options...
jclarke Posted July 19, 2012 Share Posted July 19, 2012 There isn't an API or function call available for this that I can find. So what you will need to do is get a list of the folders in the template directory and output them as select options. The php readdir function would work nice for that: <?php if ($handle = opendir('templates/')) { while (false !== ($entry = readdir($handle))) { if ($entry != "." && $entry != ".." && $entry != "index.php" && $entry != ".htaccess") { echo "$entry\n"; } } closedir($handle); } ?> http://php.net/readdir 0 Quote Link to comment Share on other sites More sharing options...
HawtDogFlvrwtr Posted July 19, 2012 Author Share Posted July 19, 2012 jclarke, Thank you for the info. I assumed this would be the final solution as I couldn't find anything either. Thanks! Chris 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.