Custom template ignored in favor of default

Permalink 1 user found helpful
Hi,

Just trying out C5 for the first time. Version 5.7.4.2.

I created my own copy of the Element theme to modify, and that went fine (thanks to https://www.concrete5.org/documentation/how-tos/designers/how-to-cop...

One of the first things I thought I would try is creating a new layout template to use.

*ISSUE: My site is defaulting to the default.php layout when I try to use my custom template. Could you help me to identify where I've slipped up?

Steps I've followed are:

1. In \application\themes\mysite\ I modified the right_sidebar.php template, and from Dashboard->Sitemap->home(on the left)->Design&Type I selected the right_sidebar theme. I viewed the home page, and sure enough I could see in edit mode that the sections I had renamed, had the new names. So I believe I'm in the correct folder.

2. In \application\themes\mysite\ I copied the right_sidebar.php template and renamed it to homepage.php. I edited it in a similar fashion, so that I would recognize if it was using this template succesfully.

3. In Dashboard->Sitemap->Pages&Themes->Page_Templates I clicked the add template button. Here I gave it the name Homepage, and the handle homepage (lowercase and without the .php extenions, as per the instructions), and then selected an icon. I then clicked Add and got the confirmation dialogue. It also now shows up on the Page Templates page under Homepage.

4. From Dashboard->Sitemap->home(on the left)->Design&Type I selected the Homepage template that was now available. I left the page type as **None (although on other attempts I selected Page. But it made no difference).

5. I viewed the home page, and in edit mode I could now see the default.php layout. I edited that file to confirm that this is what was happening, and sure enough it is the default.php from the same folder I have been working out of. I am aware that C5 uses this if it can't find a matching php filename for the template handle.

6. I checked my db via phpmyadmin and I can see my new template info with the correct name of homepage, in the pagetemplates table.

I've spent a good amount of time going through these forums and googling, but I apologize if this is a double up. I'm really grateful for any suggestions you can offer. I've likely missed something really simple in my steps.

Many thanks in advance.

 
WebcentricLtd replied on at Permalink Best Answer Reply
Hi,
have you cleared the cache and switched it off in the dashboard?
Apologies if you've written this already and I missed it.
concretekiwi replied on at Permalink Reply
Thanks Andy. I hadn't thought of that. I assume you mean that C5 has built in caching (and you don't mean the browser cache).

I'm away from the computer at the moment, but will have a dig around in the dashboard to find it when I'm back.
concretekiwi replied on at Permalink Reply
Thanks Andy. I hadn't thought of that. I assume you mean that C5 has built in caching (and you don't mean the browser cache).

I'm away from the computer at the moment, but will have a dig around in the dashboard to find it when I'm back.
concretekiwi replied on at Permalink Reply
That was it! So Simple. Thanks again Andy :)

Here's a tip for other beginners experiencing the same thing. I noticed that if I clicked on the page in the Sitemap from the dashboard, there is a link to caching which opens in a pop up window. At the bottom of that it said something like "this page is not in cache". It also had an option already set for caching to clear every 6 hours (it's been 8 hours since I last tried). For both of those reasons I almost stopped there, and believed that caching wasn't the issue.

However I went into dashboard anyway. System&Settings -> Optimizations ->ClearCache and I opted to clear the cache manually. This is what let my C5 install start using the custom template I had made.