Perch documentation

Your first content

This video will show you how to make content editable using Perch.

Our starting point is logged into the admin, with Perch installed but with no content to edit yet.

The getting started instructions are in the online Perch documentation at http://docs.grabaperch.com/getting-started

If we take a look at the homepage of my site I would first like to make the main area of text editable.

I find the file in my site folder. As you can see it has the file extension .html. I have 2 options here – to keep this as .html I will need to add a simple .htaccess file in the site root or I can change the extension to .php – to keep things simple I’ll just change the extension to .php. This won’t make any changes to the page.

Now open the page in a text editor.

At the very top of the page we need to include Perch. Do this by adding a PHP include tag:

<?php include('perch/runtime.php'); ?>

Now scroll down and find the chunk of content that you would like to be editable.

Delete this content and replace it with a Perch tag like so:

<?php perch_content('Intro'); ?>

Save the page and then go back to your web browser and reload it. You will see the content has disappeared.

Now reload the admin. You should see a new content area appear with the name “Intro”.

Click on this and on the next screen you need to set what type of content this area should have. There are some default content templates included in Perch – you can also create your own which we shall look at in a later video in this series. For now select “text block”. Submit this form.

You can now add text content. By default Perch includes a Text Block area which allows for the Textile formatting language with a simple toolbar for formatting. You can create templates that use other WYSIWYG type editor plugins as well. Add your content and submit the form.

Now reload your homepage to see the content appear.

You are now editing content using Perch.