Latest Posts

Categories

A Preview of PyroCMS Page Types

posted 2012-12-03 by Adam Fairholm

For the upcoming 2.2 release of PyroCMS, we've been working on integrating Streams into the pages fields. We went through several revisions of how that should actually work, and we're really happy with where the feature has ended up. The idea behind streams is that a single data system gives a CMS more power to manage and structure content, and page types is a major step towards making that happen in PyroCMS.

2.2 isn't out yet (we should have a beta in the next few days), but I've gotten a few questions about how page types will work, so here's a feature overview.

Video Demo

First off, to see page types in action, check out this quick demo to see it in action. It only took me 14 tries!

What Are Page Types?

Let's say you have a site of products. Each product has its own page. In the past, you would have to create a project display page in the page tree, and then display that product using streams tags. You still may want to do that, but now you have the option of having data entries represented directly in the page tree with page types.

A page type is a layout that is tied to a specific stream, so when you create a page, you fill out the data for a stream entry as well as the page fields. Then, simply use the fields from the page/entry in your layout. No pulling data from the URL necessary.

Plus, your data is still a stream. That means, if you have the streams plugin that comes with the streams module, you can display it in a cycle loop, create entry forms for it, whatever you'd like! We designed page types with maximum flexibility in mind for your content.

What Streams Can be Attached to a Page Type?

Any stream. You can choose an existing stream from any namespace, or the pages module will create one for you (in the 'pages' namespace). Also, multiple page types can use the same stream.

I Already Use the Stream Module. How Would I Use Page Types?

Let's say you are building a website for a business that has a few locations. You want to create a location index, and then have a page for each location. You've got a stream called Locations with all your location fields (address, etc.) and you want a page to display each one.

So, you'd create a page type called Location and choose your Locations stream when creating it. Add in your display logic for how to display the location in Then, when you click New Page, you can choose Location as the page type, and then add in your location data into your location fields. Your location is now both represented in your page tree and in your stream. You can use either the streams plugin or various functions in the pages plugin to list your locations as well.

I Don't Have The Streams Module Installed, Can I Still Use Page Types?

Definitely! When you create a page type, you just select the option Create New Stream for this Page Type. Once you've created the page type, you can create fields right in the Pages module. No streams module needed.

Are Page Types in Community?

Yes, they are. Community has the Streams Core module and the Stream API which allow modules to integrate streams in the community version as well as Pro. Page types is a PyroCMS Community feature.

What About Chunks and Page Layouts?

The migration from page chunks/layouts to page types is pretty simple. Page layouts become page types and are all assigned the default page stream, which has one field. That one field houses all of your chunks. So in short, your chunks will still be in tact. We recommend moving off of chunks, but they will still work.

Anything Else Fun I Should Know About?

Yes - several new features were created during the page type development process:

Through a new Event in 2.2, you can enable a field_types folder for your module where you can put module field types.

You can now save page type layouts as files. It will also save the page type CSS and JS as files.

When Can I Try It?

We're still testing internally, but a beta should be available later this week. Until then, feel free to ask questions on this post!

Comments

Dev21

2012-12-03

Great !!!
possible to add mulilanguage fields ?

Cmfolio

2012-12-03

Love it! I can't think of an easier solution in any other CMS. Well done boys.

AAAaAAaAAAaAaAAaaAaAAAaaaAAaaAAaaAAa!!!!!!!!!!! THIS IS CRAZY AWESOOOOOOME!!!!!

Wolfram

2012-12-03

Hi PyroCMS Team,

that´s great news for clients and developers! I really like how you are integrating the streams with a lot of flexibility and control. And being able to work on the layouts in an editor is another major improvement I think.

Thanks for the well thought out progress of PyroCMS!

Wolfram

Tom Dickie

2012-12-03

This looks really impressive. I can't wait for the beta. I could really do with this feature right now!

I'm curious if there would be a way of creating a listing page of pages? Would you use the streams cycle plugin on a parent page, could this be achieved without the streams plugin?

@Dev21: This hasn't been built in, so it depends on your setup and what you want to do. Feel free to email me at adam@pyrocms.com if you have some ideas for language integration.

@Tom Dickie: There's a few ways to tackle this. The fields data is still a stream you can easily cycle through that. You can also use the page plugin to cycle page data. Either way, you'll be able to list out pages.

@Tristan Jahier: Any suggestions for a replacement? I'm afraid besides TinyMC and CkEditor I'm not really up on the text editor world.

I'm looking forward to the new feature. Is beta going to be available this coming week?

Tom

2012-12-10

Any closer to a beta preview of this?

Cheers
Tom

The ability to leave a comment has been disabled for this article. This is because it's a little old and we get spammed pretty hard.

PyroCMS rocks! Don't just take our word for it, check out what these guys said:

PyroCMS is used for all TCC developments, and has kicked all other CMS's to the never-never. It has streamlined development, provided unmatched ability in flexibility and new application/module creation, and our clients are loving the simple, intuitive, yet robust administration. PyroCMS simply rocks!

PyroCMS has saved us hours of development and training time because of its intuitive interface and framework. Our clients love how easy it is to use compared to the bloated alternatives, and we love building sites with it!

PyroCMS takes everything good about some of the more powerful CMSes and brings them to the table without making the mistake many others have made — implementing them in a way that makes the features impossibly difficult to use.

Latest from the blog

A few days ago - the time came to lock in ALL the field types that come packaged in core. So I hunkered down and went on a frenzy of development to button up the core field types. I thought it would be a good time to give you all a small introduction to them and what they do! Read more