Search

Edit: Updated to Symphony 2.0: Address Book 0.3

So, I’ve started to build other things, and I thought a good place to start would be a Symphony Address Book.

Here’s the ensemble based on the work that I did for the System Navigation ensemble (which is just the basis for this work), but much improved. Basically, I discovered that we already have data sources for sections. They’re called front end entry event forms. If I modify them slightly to indicate which fields to show and which are section links, I can build a template that automatically builds the interface for managing entries, given a list of parameters.

So given a form like this:

<form method="post" action="" enctype="multipart/form-data">
  <input name="MAX_FILE_SIZE" type="hidden" value="5242880" />
  <label class="show">Full Name
    <input name="fields[full-name]" type="text" />
  </label>
  <label>First Name
    <input name="fields[first-name]" type="text" />
  </label>
  <label>Last Name
    <input name="fields[last-name]" type="text" />
  </label>
  <label class="show">Title
    <input name="fields[title]" type="text" />
  </label>
  <label class="show">Organization
    <select name="fields[organization]" class="section-link"/>
  </label>
  <label class="show">Email
    <input name="fields[email]" type="text" />
  </label>
  <label class="show">Phone
    <input name="fields[phone]" type="text" />
  </label>
  <label>Mobile
    <input name="fields[mobile]" type="text" />
  </label>
  <label>Pager
    <input name="fields[pager]" type="text" />
  </label>
  <label>Home Phone
    <input name="fields[home-phone]" type="text" />
  </label>
  <label>Deleted
    <input name="fields[deleted]" type="checkbox" />
  </label>
  <input name="action[publish-person]" type="submit" value="Submit" />
</form>

and by configuring the parameters for each of the pages:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<!-- global configuration settings in the master -->
<xsl:import href="../utilities/contacts-entries-master.xsl"/>
<xsl:import href="../utilities/html-manipulation.xsl"/>

<!-- configure entries terms -->
<xsl:param name="entries-branch" select="'ancestor'"/>
<xsl:param name="entry-type" select="'type'"/>
<xsl:param name="entries-type" select="'types'"/>
<xsl:param name="entry-type-title" select="'Contact Type'"/>
<xsl:param name="entries-type-title" select="'Contact Types'"/>

<!-- configure section link terms -->
<xsl:param name="section-parent"/>
<xsl:param name="section-parent-title"/>
<xsl:param name="section-child" select="'organization'"/>
<xsl:param name="section-children" select="'organizations'"/>
<xsl:param name="section-child-title" select="'Organization'"/>
<xsl:param name="section-children-title" select="'Organizations'"/>

<!-- configure entries root and data sources -->
<xsl:param name="entries-root" select="$current-root"/>
<xsl:param name="entries" select="$contacts"/>
<xsl:param name="entry-details" select="$contact-details"/>
<xsl:param name="section-link-entries" select="None"/>
<xsl:param name="section-link-details" select="None"/>
<xsl:param name="section-link-handle-field" select="None"/>
<xsl:param name="section-link-title-field" select="None"/>
<xsl:param name="section-link-child-handle-field" select="'code'"/>
<xsl:param name="section-link-child-title-field" select="'name'"/>

<!-- configure entries fields and events -->
<xsl:param name="entry-handle-field" select="'type'"/>
<xsl:param name="entry-title-field" select="'type'"/>
<xsl:param name="entry-event" select="'publish-contact'"/>
<xsl:param name="event-result" select="/data/events/publish-contact"/>
<xsl:param name="entries-event" select="'publish-contacts'"/>
<xsl:param name="event-results" select="/data/events/publish-contacts"/>
<xsl:param name="section-fields" select="/data/form/label[normalize-space(text()) != 'Deleted']"/>

</xsl:stylesheet>

You can build a trinity of all sorts of different data sets.

Address Book Ensemble 0.3

Updated the ensemble from Symphony 2 Beta Revision 5 to Symphony 2.0 (zip download). It also includes a brief introduction to Symphony that provides a quick tour of the system.

very nice, bauhouse. i was actually thinking of making an address book for myself b/c i'm sick of being tied to my cell carrier for housing all my phone numbers. I'll take a look at this when I get a chance.

Hope this comes in handy, wtdtan.

I made some modifications to the databases to make the pages much easier to configure (hopefully). Squashed some bugs and made the templates much more flexible and portable.

For example, all form fields are built and populated based on a single static XML data source:

<sections-forms>
  <section branch="ancestor">
    <title lowercase="menus" handle="menus">Menus</title>
    <type lowercase="menu" handle="menu">Menu</type>
    <form method="post" action="" enctype="multipart/form-data">
      <input name="MAX_FILE_SIZE" type="hidden" value="5242880" />
      <label class="show">Title
        <input name="fields[title]" type="text" />
      </label>
      <label class="show">Description
        <textarea name="fields[description]" rows="15" cols="50"></textarea>
      </label>
      <label>Deleted
        <input name="fields[deleted]" type="checkbox" />
      </label>
      <input name="action[publish-menu]" type="submit" value="Submit" />
    </form>
  </section>
  <section branch="parent">
    <title lowercase="sections" handle="sections">Sections</title>
    <type lowercase="section" handle="section">Section</type>
    <form method="post" action="" enctype="multipart/form-data">
      <input name="MAX_FILE_SIZE" type="hidden" value="5242880" />
      <label class="show">Title
        <input name="fields[title]" type="text" />
      </label>
      <label class="show">Menu
        <select name="fields[menu]" class="section-link"/>
      </label>
      <label class="show">URL
        <input name="fields[url]" type="text" />
      </label>
      <label>Heading
        <input name="fields[heading]" type="text" />
      </label>
      <label>Description
        <textarea name="fields[description]" rows="8" cols="50"></textarea>
      </label>
      <label>Body
        <textarea name="fields[body]" rows="16" cols="50"></textarea>
      </label>
      <label class="show">Sort
        <input name="fields[sort]" type="text" />
      </label>
      <label>Deleted
        <input name="fields[deleted]" type="checkbox" />
      </label>
      <input name="action[publish-section]" type="submit" value="Submit" />
    </form>
  </section>
  <section branch="self">
    <title lowercase="pages" handle="pages">Pages</title>
    <type lowercase="page" handle="page">Page</type>
    <form method="post" action="" enctype="multipart/form-data">
      <input name="MAX_FILE_SIZE" type="hidden" value="5242880" />
      <label class="show">Title
        <input name="fields[title]" type="text" />
      </label>
      <label class="show">Section
        <select name="fields[section]" class="section-link"/>
      </label>
      <label>Heading
        <input name="fields[heading]" type="text" />
      </label>
      <label>Description
        <textarea name="fields[description]" rows="8" cols="50"></textarea>
      </label>
      <label>Body
        <textarea name="fields[body]" rows="16" cols="50"></textarea>
      </label>
      <label class="show">URL
        <input name="fields[url]" type="text" />
      </label>
      <label class="show">Sort
        <input name="fields[sort]" type="text" />
      </label>
      <label>Deleted
        <input name="fields[deleted]" type="checkbox" />
      </label>
      <input name="action[publish-page]" type="submit" value="Submit" />
    </form>
  </section>
</sections-forms>

Then, it's just a matter of point the templates to the right data sources and section fields to populate the pages. Only the parameters that start with the comment configure need to be modified. Once properly configured, the templates will build the pages dynamically.

Final Beta Release: Address Book 0.2

I've standardized the code for both the Address Book sections and the System Navigation sections so everything is working the same way - exactly the same underlying code for driving the templates with only variations in the configuration parameters.

I think I have squashed all the bugs and all the features I had intended to include are working as intended. Database structure has been finalized and configuration comments included.

The Address Book is the first step in building out the rest of the DesignAdmin application:

  • Site
  • Contacts
  • Projects
  • Accounting
  • Brand Assets

@bauhouse - you are working amazingly hard on this! I had installed v.0.1.6 (was it?) of the System Navigation ensemble, but ... updates came out so quickly! A couple questions:

  1. What is the relationship of this Address Book (ABe) ensemble to the System Nav (SNe) one? I've read your posts with care, but am still a little puzzled. Is the ABe simply (!) the SNe with some added ... stuff? or are they more parallel/distinct builds of similar systems? (In short, if I install ABe, do I get SNe at the same time?!)

  2. Do you have a road map? :) I'd love to start exploring these, but ... I'm getting dizzy! :)

Thanks for your help with this!

David.

David, you're right that these ensembles need some better documentation. You are also right that the Address Book ensemble is simply the System Navigation ensemble with the additional sections for contacts, organizations and people.

The idea is that it is possible to use the same templates to build relationships between different sections. So the plan is to build each module on top of another to develop a complete project management system. First, I needed to build a way to manage the site. Then, I needed a way to manage contact information for clients. Now that this is built, I can create another set of sections linked to the address book for projects.

  • Projects
  • Tasks
  • Timesheets

Or I can create a module for maintaining a database of countries and cities

  • Countries
  • Regions
  • Cities

Before I write the documentation for these ensembles, I want to see whether I can extend the templates to create other modules. For now, I'd suggest playing around with the Address Book ensemble. Start by modifying the static XML data source called Contacts Sections. You'll see how adding or removing the "show" class on the field labels will change how the data is listed in the list views.

Brilliant! Thanks for the clarification -- I'm looking forward to exploring!

This ensemble has been updated to be in sync with the latest Projects ensemble.

Address Book Ensemble 0.3

Updated the ensemble from Symphony 2 Beta Revision 5 to Symphony 2.0 (zip download). It also includes a brief introduction to Symphony that provides a quick tour of the system. (See above)

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details