Can multiple page types use the same base php file?

Permalink
Here's what I'd like to do:

Use one generic page type template.

Pre-populate that template with a variety of blocks by default (I already know how to do that in the dashboard).

End up with several page types that the user can select from that each have a different configuration of default blocks, but use the same page_type.php file.

Possible?

It seems silly to have page_type1.php, page_type2.php, etc that are exact duplicates just so I can have different sets of default blocks.

Thanks for your help!

kirkroberts
 
RadiantWeb replied on at Permalink Reply
RadiantWeb
pretty sure that is the only way you can do it. but it's not hard to just duplicate your theme view and name it something else, then add it, rinse and repeat. From the user stand point, once it's set up, the workflow is the same as what you proposed. you are just trying to short cut it.

But pageTypes are called by unique handles. if you try to double up on one handle, you are going to explode things.

C
kirkroberts replied on at Permalink Reply
kirkroberts
D'oh!

I realized that, for my purposes, I can use default.php as my generic template.
Then I can create new page templates that don't have php files associated with their handles (eg "page_type" -> "page_type.php").
Each page type (with a unique handle) will use the default.php template (because there is no php template with that handle name) and I can assign whatever default blocks I want.

At least in theory :-)
ScottC replied on at Permalink Reply
ScottC
Actually i re-read that again, and you can do the whole implied page types or simply do something like a switch statement on areas based on the collection type handle in the same php file. This gets a little more complex but getting a collectiontype (or page_type if you must) isn't too bad from code.