Front to Back, take 2, step 00

Revisiting the idea.

The old idea

Some time ago I’ve played with the idea of a different approach to small website projects called Front to Back; it was greatly inspired by Perch CMS but was not, in its first incarnation, a viable solution to my problem.
In essence the plugin would read template files containing special tags, and here is the inspiration taken from Perch CMS, to compile real template files and another file that would in turn be read to add meta boxes to a single page admin screen. Writing this in the 'page-about.phptemplate file

<ftb:text title='Some text' default='Hello world'>

should have led to a text input meta box showing up in the “About” page administration screen. With no more coding than that involved on the developer side.
The idea is still one I’m willing to explore: creating an easy way for a WordPress site administrator to manage what appears on a page and for a developer to create and use custom fields to customize each page in a unique way. Again in a way similar to what Perch does .
The initial approach based on the use of a convoluted back and forth mechanism of template files and meta box providing frameworks proved too complicate to maintain for any measure of flexibility and maintainability to apply.

No more theme options

It’s not much time that WordPress.org hosted themes are required to use the Theme Customizer to present and manage theme options and while I do not want to enter the controversy whether this is a good approach or not I feel this could be a road worth investing some time into.
I will try my hand again at the idea underlying the “Front to Back” plugin this time targeting the Theme Customizer specifically.
So no more meta boxes on the single page edit screen but panels and sections and options in the Theme Customizer.
As any project I will start from some user stories to have an objective to code to:

Marc would like to create a website to support his idea of a small team of specialized chefs that will be available for at home dinner preparation. In this initial phase the website will be made of two pages; common to both will be the company name, a tag line and the footer with some copyrights disclaimer and social links. The landing page will have a section about what Marc and his colleagues offer that’s made of a paragraph and 3 pictures and a simple contact form. A second page will have a section dedicated to each chef (Marc plus two) each made of a small paragraph and a picture.

Decomposing the requirements the site will be made of two pages:

  • front page
    • header
      • site title
      • site tagline
      • logo
    • body
      • what we do
        • description paragraph
        • 3 pictures
      • contact form
    • footer
      • social links
  • about page
    • header
      • site title
      • site tagline
      • logo
    • body
      • who we are
        • chef 1
          • description paragraph
          • 1 picture
        • chef 2
          • description paragraph
          • 1 picture
        • chef 3
          • description paragraph
          • 1 picture
    • footer
      • social links

As frequently happens the pages will share the header and footer sections and differ in the content section.
Now on the developer side:

Luca is a web developer tasked with the creation of the theme responsible for Marc’s website appearance and he would like to be able to scaffold a bare minimum WordPress theme consisting of the style.css andindex.php files. Tapping into the possibilities offered by the “Front to Back” plugin he will not write the two templates files needed to give the site front page and the “About Us” page each a different look and will not write the code needed to add the required Theme Customizer settings.
He will instead write just two templates in the theme ftb-templates subfolder called front_page.php and about.php using some “Front to Back” specific markup as well as WordPress template tags, and have the page templates generated for him in the theme root folder.

The objective of “Front to Back” is not to be a tool that site administrators will use but one that I, as a theme developer will be able to use to quickly generate a theme template files; it will not be a static site generator and will not be a tool suited for projects with many pages.

Next

Before scaffolding the trial theme I will try out how flexible the Theme Customizer API is and will do that with some trial and error approach.