A couple of days ago we were working a skeleton template that is used to display some articles in lightbox popups. The template was very straightforward and had a few lines of code and had only one module position. We created the xml manifest file and then we packaged the template into a zip file and we installed it. Everything worked smoothly. But, when we assigned a menu item to that template (or should it be when we assigned that template to a menu item? Anyway, you get the point), we where greeted with the following error:
The template for this display is not available. Please contact a Site administrator.
…and Joomla’s fallback template was used (the fallback template is Beez 20, for those who don’t know). Hmmm!
We checked our code, and we checked whether the name of the template (in the manifest file) was legitimate (e.g. just alphanumeric characters), we also checked whether the code had any errors, but nothing! Everything was OK – we then checked whether the new template folder was physically created under the templates folder and it was! We even uninstalled and reinstalled the template (note: when we deleted the template we saw this error). Double hmmmm!
So, we checked which file was spitting this error, and we found out that it was the application.php file (located under the includes directory of the Joomla website) at line 492. Here’s this line along with the lines before and after:
if (!file_exists(JPATH_THEMES . '/' . $template->template . '/index.php')) {
JError::raiseWarning(0, JText::_('JERROR_ALERTNOTEMPLATE'));
$template->template = 'beez_20';
So… It seems that Joomla is really not able to see the index.php file, so, we browsed to the templates folder, and we checked whether the index.php was actually located under the skeleton‘s template folder, and, to our surprise, it wasn’t: we forgot to include the index.php in the manifest file! Simply uploading the index.php to that template’s directory solved the problem! Yes – we know it’s a bit silly for Joomla experts to make this mistake, but we’re only human, after all!
Are there any other reasons that can cause this problem?
There are two other reasons that can cause this problem:
- Using non-alphanumeric characters to name your template (remember, the folder name of the template will be the same as the template name – so, using characters that are illegal in folder names might cause this problem. Sticking with alphanumeric characters is a best practice).
-
Installing the template through unconventional means resulting in Joomla not having the necessary file permissions to access the index.php file.
If you are having the problem and you’re still having some hard time solving it even after reading the above guide, then fear not – we’re here to help. All you need to do is to contact us and you can rest assured that we can solve your problem in no time and at a very affordable cost!