"page_types" directory

Permalink
There's a section of the render method in the View class (around line 636) that checks for templates in a directory called "page_types" in various locations such as DIR_BASE/page_types, DIR_BASE_CORE/page_types, DIR_PACKAGES/pkgName/page_types, etc... Can someone with some knowledge of C5 history explain the status of these directories. They don't exist in the file structure for the current version. Are there still active add-on packages that use these directories?
agedman
View Replies: View Best Answer
Mnkras replied on at Permalink Best Answer Reply
Mnkras
i know the calendar package has it, and i think discussion and a few others, its to install custom pagetypes independent of themes
agedman replied on at Permalink Reply
agedman
Thanks Mike! I'm still pretty confused about how this works, though. For example, does themeOverride need to be used in conjunction with these? It looks like they're generating innerContent that needs to get wrapped in a view.php somewhere, but I'm not sure...

Can you point me to any docs or posts that explain how to use this sort of page type? If not, can you think of any free add-ons that might use this technique?
Mnkras replied on at Permalink Reply
Mnkras
i guess you can say, that its a generic singlepage, here is an example of a pagetype right from the calendar adoon,

http://pastie.org/1094668
agedman replied on at Permalink Reply
agedman
Thanks again! I bought the calendar block so I can see how everything works now. I'm sure that license will come in handy some time.

I took the $55 out of the beer allowance my wife gives me. So let's see, 1 pint of Hamm's per day x $0.65 / pint... I should have it paid off in about 2.8 months, so around November 8th. I'll put that on my new calendar! ;)
agedman replied on at Permalink Reply
agedman
In case anyone else is wondering about this at some point and is hungry for more details. Here's my opinion on how these things work in a nutshell:

They are exactly like a normal page type to a large extent. They're registered with the database in the PageTypes table, so they show up on the list of Page Types in the Pages and Themes area of the dashboard. You can use the Page Defaults, assign default attributes, etc... Any number of pages can be set to the page type -- all just like a regular page type.

The difference is in the file system -- whereas regular page types get rendered either by a template in the page's theme that has a file name matching the page type's handle OR by the default.php template in the theme if there's no match -- THIS KIND of page type gets rendered by having its content dumped to a variable called $innerContent which is then wrapped by the view.php template in the page's theme (this is the way things work for single pages). Any questions?