Things developers should know about Perch

You know that Perch is the really little CMS, but we frequently find that our customers are not aware of all of the power and flexibility built into Perch. Perch is highly extensible in a number of ways, can be used alongside another application or as the framework for a comprehensive add-on incorporated into the Perch admin UI.

Use your own HTML … or XML, or JSON

You already know that Perch doesn’t dictate your mark-up. Our template system means that you are in complete control of every HTML tag added to your site. However, did you know that you can also use Perch to create an XML or JSON file? Any text format can be edited by Perch, the file just needs to be parsed as PHP by adding an AddType declaration in your .htaccess file.

Brand the admin your way

When installing Perch for a client you can remove our branding, select your own colour scheme and even rename the Perch directory to something else. If you want to take it a step further and create a customized interface for your clients then you can add your own UI Customizations.

Use Perch to manage microcopy in a larger web application

As Perch doesn’t take over your entire site, it can be very handy to use for the small bits of text found in a larger application and can sit alongside other frameworks happily. We know of people using Perch alongside frameworks such as CodeIgniter and Zend Framework. The set_page() method of the PerchSystem class will help you to identify pages if you are working with a Front Controller and routing system.

Extensible Field Types

In Perch a Field Type is just that – a type of field used for entering content. Perch Field Types give you control over how the content is captured, stored, and presented to the template system. These can be as simple as a single form text field that outputs a line of text, to something more complex like the Google Maps Field Type that enables a user to select a location by panning and zooming a map and then displays that as a map on the website.

Our YouTube Field Type asks for a video URL, then uses a Google API to look up the title, description and embed code information to add the video to the page. The Album List Field Type supplied with the Gallery app queries across apps and provides an easy way for a content editor to pick and link to one of their albums. If you can figure out how the input and output should work, it can probably be built as a custom Field Type.

If you have a little PHP knowledge then you can easily create your own Field Types. The Field Types documentation can be found in the API section, and we have also a short tutorial and example Field Type to get you started.

Full developer API

Creating a robust API and plugin architecture for Perch has always been an important part of developing this product. We want developers to be able to add their own applications into the admin, and the Perch API allows you to do just that. All of the official Perch apps are developed using the same API, so it is constantly being improved as we find things that would be helpful to us. The official apps can also be useful as examples of API usage when you are developing your own apps.

Get started with the API documentation, and let us know about apps you do develop, even if just for personal use. We are always keen to talk to developers who use the API to find out ways in which we can make it more useful for you.