My New Page Types will not use anything but default.php

Permalink
For some reason, my theme will not use any of the .php templates that I have built. For instance, in my theme file, there is a template called "gridLayout.php" In Page Types I have created a "Grid Layout" page type with handle "gridLayout"—shouldn't that be all I need to do. I cannot see the template in the Defaults mode, or when I create a specific page of that type. I must be missing something simple. Help!

russellbits
View Replies: View Best Answer
justrj replied on at Permalink Reply
justrj
Good morning!

Try grid_layout.php for the file and grid_layout for the handle. That should fix it.
russellbits replied on at Permalink Reply
russellbits
Good try, but I'm afraid that did not affect the problem. Even with gridLayout.php renamed to grid_layout.php and the page type done the same I am still only seeing the default template. I tried uppercasing and dashes as well. No dice.
justrj replied on at Permalink Best Answer Reply
justrj
hmm that should get it done. c5 checks for underscores, not camel case.
name: Page Type
handle: page_type
file name: page_type.php

..maybe it's not installed.

Go to dashboard > themes > themename > inspect, if there is a check box to create the page type, do so and save the change.

more info on that whole deal:http://www.concrete5.org/documentation/using-concrete5/dashboard/pa...
russellbits replied on at Permalink Reply
russellbits
No need to worry about underscores so long as the handle for the Page Type matches the template file. You can use camel casing just fine. The real trick—as you pointed out—was to use the inspect tool.
Steevb replied on at Permalink Reply
Steevb
Did you try: dashboard - themes - yourtheme - inspect - and ok the new 'ticked' page types?
russellbits replied on at Permalink Reply
russellbits
Just did—worked like a charm. Hadn't realized what that inspect button was.
joustmultimedia replied on at Permalink Reply 1 Attachment
I'm having the same problem, only I've done everything you guys suggested. My page type file is custom.php. I checked to make sure it was properly uploaded to my theme folder and checked the Inspect page. I've attached a screenshot of what it shows.

Any time I create a new page and assign it the custom.php page type, it just shows the default.php. I had the same problem with the other pages. It required me going into the database and deleting all the page types that were having that issue, uninstalling, re-installing and re-activating my theme, and when I re-installed it, it asked if I wanted to make the php files that it found into page types. I'd rather not have to go through this process every time a add a new page type though.

Any suggestions?
justrj replied on at Permalink Reply
justrj
Is this theme in a package, or in the themes folder of your site?
joustmultimedia replied on at Permalink Reply
My theme is in the main "themes" folder in the root.
justrj replied on at Permalink Reply
justrj
hmm...have you cleared your cache lately? According to your screenshot, the page is installed and the custom page type should be available to use.
joustmultimedia replied on at Permalink Reply
YAY!! That did the trick. Thank you for the quick reply.
dantheman replied on at Permalink Reply
dantheman
I've been having the same difficulty - newly added Page Types (in Concrete5 5.6.3.1) were ignored and content was presented using default.php instead - and I tried several things:
- turn off the cache
- clear the cache
- manually deleted most of the contents of /files/cache/
In the end removing this file:
/files/cache/environment.cache
did the job.
I'm noting it here in case it's useful to anyone else. Since removing the file it has not been recreated and I don't (remotely) understand its purpose.