Understanding Page Types
Permalink
Having read through the forums and docs I have a basic understanding of C5 now, but I am sure I missing something.
So a Theme is a collection of Page Types and each of those can have their own layout and default blocks.
But where do the Page attributes come in? So I can add an attribute. but what do I do with it? And am I right about a Page Type being a Template?
Would love to hear from anyone who has this sussed.
mrA
So a Theme is a collection of Page Types and each of those can have their own layout and default blocks.
But where do the Page attributes come in? So I can add an attribute. but what do I do with it? And am I right about a Page Type being a Template?
Would love to hear from anyone who has this sussed.
mrA
but I feel I am still missing something.
I have just about finished an events block, but I was kinda thinking that I should be using a page type for each event in a similar way to how you suggested for the recipes.
So what am I missing? I can see that the attributes would be added to the page type, but then how are these added to the page type? There is no block, so is this a development thing in PHP?
BTW absolutely love what you have achieved with C5. After spending much time with Joomla, Mambo, Drupal and eventually writing my own CMS, I have recently picked up C5 and am loving the interface. just feel that there are a few bits to get understood, then I will be off.
mrA
I have just about finished an events block, but I was kinda thinking that I should be using a page type for each event in a similar way to how you suggested for the recipes.
So what am I missing? I can see that the attributes would be added to the page type, but then how are these added to the page type? There is no block, so is this a development thing in PHP?
BTW absolutely love what you have achieved with C5. After spending much time with Joomla, Mambo, Drupal and eventually writing my own CMS, I have recently picked up C5 and am loving the interface. just feel that there are a few bits to get understood, then I will be off.
mrA
you can define attributes on the dashboard side of things.
you can then assign specific ones to always be available to that page type
you set them from the properties tab
you can get at them from the collection object, and you can also get at them from the page list - but yes, both in PHP.
There's a block in review right now that just spits out the page attributes on the page..
that help?
you can then assign specific ones to always be available to that page type
you set them from the properties tab
you can get at them from the collection object, and you can also get at them from the page list - but yes, both in PHP.
There's a block in review right now that just spits out the page attributes on the page..
that help?
Think I was looking for something in the GUI/Dashboard, but that all makes sense now.
I will get on with finishing off my block for publishing to the marketplace then.
mrA
I will get on with finishing off my block for publishing to the marketplace then.
mrA
I was following you until the page Attributes.
So in my scenario I have a page type of products.php which displays a list view of the products. When someone clicks a category I want to only display those products in that category, and to take it a step further I want to show the product detail page when a product is clicked.
How would I use page types in this scenario? I am not following the logic of attributes or how I would use them?
So in my scenario I have a page type of products.php which displays a list view of the products. When someone clicks a category I want to only display those products in that category, and to take it a step further I want to show the product detail page when a product is clicked.
How would I use page types in this scenario? I am not following the logic of attributes or how I would use them?
I'd have a page type of products.
on it i'd define everything i wanted to search by or show at a summary level as a page attribute. I would then make one page per product.
Each of those product pages would live under a category page. i might make a page type for this page too, although it's less important. On this page I'd use a page list block to make the list of products you're talking about.
The advantage is now every product can have an image gallery added, or a guestbook for support, etc...
you can even alias the product page to multiple category pages using the sitemap
on it i'd define everything i wanted to search by or show at a summary level as a page attribute. I would then make one page per product.
Each of those product pages would live under a category page. i might make a page type for this page too, although it's less important. On this page I'd use a page list block to make the list of products you're talking about.
The advantage is now every product can have an image gallery added, or a guestbook for support, etc...
you can even alias the product page to multiple category pages using the sitemap
Now I understand what you mean, that was much clearer, although my concern is I have hundreds of products. That would pretty tedious to add all of those product pages.
Is there a better way of handling a situation where there is one list view and one detail view and just pass it a parameter.. like product id or category id?
I wasn't even sure how to pass get variables from a view to a controller?
Is there a better way of handling a situation where there is one list view and one detail view and just pass it a parameter.. like product id or category id?
I wasn't even sure how to pass get variables from a view to a controller?
for joining in - these conversations help get the understanding into us as users.
but not today...
some type of bulk creation from XML is on our radar of awesome tools to have..
in the meantime - yer hitting that table by hand, or you're hiring an intern with this approach... the big picture flexibility you get for it is totally worth the pain tho.
some type of bulk creation from XML is on our radar of awesome tools to have..
in the meantime - yer hitting that table by hand, or you're hiring an intern with this approach... the big picture flexibility you get for it is totally worth the pain tho.
Is there a way to write a script that would add each page to the site? So let's consider my example of products.. I have a CSV file containing each page's content, if I parse through that data and for each row wanted to programmatically add pages to the site. What things would I need to consider?
It seems fairly straightforward but I am not sure all of the tables that would need updated in order to add a page nor if this is possible at this point. Has anyone had success with doing something like this or using XML as you suggested?
I am considering writing a block "Repeater" which would solve the business problem of adding a list/detail view functionality to concrete without hacking the core. Also I use a framework called Recess and was wondering what would be involved in adding a CRUD app engine as a package or something?
Obviously I could just add my controllers to the page type but the next time I need to do this I would need to rewrite it again. Any ideas community?
It seems fairly straightforward but I am not sure all of the tables that would need updated in order to add a page nor if this is possible at this point. Has anyone had success with doing something like this or using XML as you suggested?
I am considering writing a block "Repeater" which would solve the business problem of adding a list/detail view functionality to concrete without hacking the core. Also I use a framework called Recess and was wondering what would be involved in adding a CRUD app engine as a package or something?
Obviously I could just add my controllers to the page type but the next time I need to do this I would need to rewrite it again. Any ideas community?
which is ran @: ~/concrete/controllers/install
What is cool about this file is you can pair down installed blocks, things like that:
Here are two pages being added, albeit blank:
What is cool about this file is you can pair down installed blocks, things like that:
Here are two pages being added, albeit blank:
$data = array(); $data['uID'] = $this->installData['USER_SUPER_ID']; $data['name'] = t('About'); $aboutPage = $home->add($dt, $data); $data['name'] = t('Examples'); $examplesPage = $home->add($dt, $data); $data['name'] = t('Contact'); $contactPage = $home->add($dt, $data);
I don't see anywhere how you might do that. I asked a question under a separate thread about having my own default page layout without editing the template code. This sort of touches the same issue. I'd hate to have to figure out how to create a template just to make my site look the way I want without customizing every single page.
goto Dashboard > Pages & Themes > Page Types
every page in your site MUST have a type.
every page in your site MUST have a theme.
The page looks to the theme directory for a page name matching the type, and uses that for rendering.
If it can't find a match for the name, it will use default.php.
The means you might use page types for layout options in a direct 1 to 1 relationship as we do in plain yogurt.
This also means you might use page types for more data model type stuff.
For example, we recently suggested to someone to NOT make a recipe block for their culinary site, but rather make a recipe page type. The layout was the same as their default layout but now they could associate custom attributes with just those pages like "is this low fat, which meats are in it, etc". All that data becomes useful for searching and sorting using stuff like the page list block, and you are creating something that is far more extendable than a block. If the site owner wants to add a survey or a guestbook to each recipe, its just adding a block to the defaults for that page type..
does this help?