Help N00bie Q: Designing different page types

Permalink
Hello one and all.
Today is my first day in C5 and I have it all working with my first page.
BUT
For my other pages I have pretty much the same layout out but Divs shift around slightly.

Now my question is.. how do I adjust the layout for each page... sometimes one column, sometimes two. I know I have to use page Types somehow but how do I specify the div positions of each page? Does C5 generat their own div names?

Sorry if this is a basic question I am just at a loss how I can progress further.

Thanks
D!!

dancer
 
elyon replied on at Permalink Reply
elyon
A great place to start is to take a look at the core themes, located under /concrete/themes. You can also look up the help documentation:

http://www.concrete5.org/documentation/developers/pages/themes...


Each page type is its own PHP file, which can basically be an HTML file with the file extension changed. The core themes use imports to reuse the same header and footer in all of the page types, so that you don't have to duplicate your work. You can put all the header stuff in one file, then set up the middle to have the right amount of columns, then set up a footer.

I usually use unique ID names depending upon how it is set up. For example, I might use "main", "left-sidebar" and "right-sidebar" as my IDs. If I have some left-sidebar specific styles I need to apply to my "main" div, I might also add a "with-left-sidebar" class, so I can apply the adjustments accordingly. Otherwise you can obviously add some inline CSS, even if it isn't very object-oriented.
dancer replied on at Permalink Reply
dancer
Hey, thanks for the speedy response.
I know what you're saying... I have the header and footer fed in like an include...

In the Core version there is only one file though.

How would I call all the various files into the Dashboard and adjust each page? Would they appear in my page types?

I think I am getting a little confused. I will have a read through the link you posted tomorrow. It's late here and I need some sleep.

THanks again though
elyon replied on at Permalink Reply
elyon
Oh, okay. Try looking at the "Plain Yogurt" theme, under /concrete/themes. It should have the header and footer broken up into separate files in an /elements directory, and a PHP file for each page type. The important thing is that you have a PHP file for each of the page types you want to support. The rest is just up to how you want to structure your directories and files.
damery replied on at Permalink Reply
damery
Hello I break the page up into thirds.
Header
page type
footer
with links to header and footer in each page type.
The default is oddly enough default (usually a left side bar)
then you can have
right sidebar
three column
full
and last but not least view.
I use an adobe air tool called BOKS to created the page pieces then I style them in Netbeans css editor and play around with the php sometimes ...
Let me know if you want my basic default template so you can change the style as you wish. I usually use a 960 grid style.
dancer replied on at Permalink Reply
dancer
Ok, so it's Thursday morning and I have been thinking this problem to sleep.

I have attacked it in a more locical way and I think I have it.

What was confusing me was that you had the 4 page type options but only one default file. (this still confuses me)

So. For those still learning:
1. I create a new layout and save it as a PHP file named "whatever.php" (for me it was dance_left.php)
http://i44.tinypic.com/29pxevl.jpg...

2. Create a thumbnail call it anything and place it in concrete/images/icons/page_types/

3. Goto Dashboard > Pages & Theme > Page Types and add a new Page Type and where it says Handle use the same file name without php:
http://i40.tinypic.com/20qks5v.jpg...
And select your new thumbnail ("F" is irrelevent just there so I can identify it):
http://i44.tinypic.com/14mrgjp.jpg...

4. Now you can chose your Page type from the List.

Damery/Eylon Please let me know if I have explained wrong.

I guess the option of selecting from 4 already suggested layouts confused me. I thought C5 was looking for specific Div Names and then adjusting the layers accordingly

D!!
elyon replied on at Permalink Reply
elyon
Yep, that's sounding good.

Exactly ... the default page types are there to help bring consistency between themes. If you adopt the same types, the site will port directly to other themes pretty easily. If you use a unique page type, you may need to change those pages to use a standard type once (and if) you change the theme.

You're exactly right that you can call it whatever you want, and that correlates to what the page type will be called, so "Dancer Left" would be dancer_left.php. The default is there to handle any page types which don't exist in the theme. So let's say you have a left-sidebar defined, but no right-sidebar? You can delete the right-sidebar page type, or you can create a default.php file, and throw in a PHP include so that it pulls in your left-sidebar style. Now anything which does not exist will default to using the left-sidebar.

Also, you might notice that the structure inside the /concrete folder is identical to the structure outside of it. Instead of placing your icon in the /concrete directory (which will get wiped out, potentially, if you upgrade your Concrete install) I would recommend putting it in /images/icons/page_types/ instead and seeing if that works.

Yeah, the system is a lot more versatile this way, I think, than other CMS solutions I've used in the past where you have to restructure a set layout. I love that you can lay it out however you want to, then drop in the header required, footer required and code to define each of the block areas and you're good to go