Forum

Thread tagged as: Discussion, Question

Layout, Pages… Confusion!

Hi,

Very new to Perch, having only installed a local version yesterday to play around with before starting a project for real next week! I am getting myself into a pickle and I am just hoping for some direction to tutorials.

All the tutorials tend to take a static HTML page and convert to a Perch CMS. This maybe the wrong way to think about it, but this reverse engineering approach isn't really what I want. I would like to create the site in Perch from the beginning, so that when my client decides to add a new page, the page takes on the look of the site I have created. They enter the page info, add page to the menu of choice and away they go. This is the goal!

I understand that layouts allow me to create headers, content areas and footers. So should my workflow be something similar to:

Create layouts for header, content and footer including data that can be changed by the client, page title for example. Include these in the default.php under Pages. ( <?php perch_layout('global.header'); ?> ) Create each required page in Perch itself, rather then individual files in the root.

Having tried this approach, on creating the page in Perch admin, the rendered page contains non of the items from my header and footer layout?

This could be totally the wrong approach, if so, please let me know.

Thanks in advance

Grant Smith

Grant Smith 0 points

  • 4 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

You need to create a Master Page, this is used to create the new pages with the look and regions that you want.

Layouts are just includes with some Perch specific functionality.

https://docs.grabaperch.com/video/v3/creating-pages/

Hi Rachel,

Thanks for the swift reply. So in terms of site style and layout, I need to create a new php file for each page? For example, index.php for home, contact.php and so forth? Repeating common information with the use layouts?

Hi Grant

Welcome to Perch. I would say that the standard process for getting Perch up and running is not a reverse engineering approach at all. It's a lot quicker to build a site this way than trying to wrestle with a CMS and design a layout all at the same time.

I'd really recommend that you put Perch to one side until you've got your own page templates working in the browser. You'll save yourself a lot of time and frustration this way.

It's important to note that Perch isn't like, say, Wordpress - it doesn't come with any layout templates. It's a totally open CMS that gives you tools to build sites on your own terms, rather than adapting your designs to suit a certain template.

Once you are happy with your layouts, then you can turn them into Master Pages in Perch. Users will use them to populate new and existing pages with content.

Hope this helps, and best of luck with your project.

Jon

Hi Grant

Perch will create the physical php pages using your Master Page templates as a starting point.

And, yes, common info can be put into Layouts and shared across pages.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Master pages are your different types of page. So you'd typically have one for the home page, an article page, a listing page etc. The sort of things that in the bad old days you'd mock up in Photoshop to figure out the design.

Those master pages can use layouts and any other page functions.

When you create a new page, Perch will create a file that includes that master page.

If you don't want all those files (understandable) that's where Runway comes in.