Published:
11 February 2010

Step 1. Extend Your Greetings Section

For this site we're going to build, we want to have more interesting content to work with than simple one-line greetings. Taking a moment to extend our old Greetings section is a good first step because content modeling is often where Symphony projects begin. Below, we'll use the section editor to restructure and add some new fields to our section.

1.1. Rename the Existing Field

In the admin interface, navigate to Blueprints > Sections and click "Greetings". Look at the "Fields" section. Right now, we've only got a single field called "Greeting Text". We'll want to keep that field intact, but have it serve as more of a title for each Greeting entry, so let's change its Label to Greeting Title.

1.2 Add Content, Date, and Language Fields

Next we'll add three new fields to make our entries more interesting:

  1. First, a field to hold textual content. From the field type selector, choose Textarea and click "Add item". A new field settings panel will appear. Enter Greeting Content as the Label, and enable Markdown in the field by choosing "Markdown Text Formatter" in the Text Formatter field.

    Enabling the formatter will help ensure that our content is clean and well-formed for HTML. If the Markdown option is not available, you'll need to first enable it.

  2. Next, a simple date field. From the field type selector, choose Date and click "Add item". We'll simply Label it Date and choose "Sidebar" from the Placement dropdown.

    Placing certain fields in the sidebar helps keep our backend forms visually organized.

  3. Finally, since we've got greetings in multiple languages, let's add a language field. From the field type selector, choose Select Box. Enter Language as the Label, and choose "Sidebar" as its Placement. We'll use Static Options to populate the options for our language select box, so enter this (comma-delimited) list of the world's twenty most widely-spoken languages:

    Chinese, Spanish, English, Hindi, Arabic, Bengali, Portuguese, Russian, Japanese, German, Javanese, Punjabi, Wu, Telugu, Vietnamese, Marathi, French, Korean, Tamil, Italian

    Tick the Show Column box, so that we'll see our entries' languages when browsing our Greetings index in the back end.

That'll do for now. Your section editor screen should look like Figure 1. Click Save Changes.

1.3. Update Your Entries

Now let's go back to our entries. Navigate to your Greetings index (Content > Greetings). Click on "Hello World!" Your entry editor has changed:

Hello Symphony: Entry Editor

You'll notice that the two fields whose placement was "Sidebar" now appear on the right side of your screen. The Date field is autopopulated with today's date, and the Language field has pre-selected the first available option.

Set the language to English, and paste this text into the Greeting Content field:

Here is Edward Bear, coming downstairs now—bump, bump, bump—on the back of his head, behind Christopher Robin. It is, as far as he knows, the only way of coming downstairs, but sometimes he feels that there really is another way, if only he could stop bumping for a moment and think of it.

Save your changes.

Now go back to the Greetings index and click "G'day World!" Let's take advantage of our new language field. Change the Greeting Title to Hola Mundo! (sorry, Aussies) and set the Language to Spanish. Paste the following text into Greeting Content:

He aquí al Oso Eduardo bajando las escaleras con la cabeza—plom, plom, plom—de la mano de Christopher Robin. Es la única manera que él conoce de bajar las escaleras, aunque a veces piensa que deber haber otra forma mejor que seguramente la descubriría si pudiera dejar de darse golpes en la cabeza y pararse a pensar.

Save your changes. One more to go.

From the Greetings index, click "Hallo Welt!" Choose German from the Language dropdown, and paste the following into Greeting Content:

Hier kommt nun Eduard Bär die Treppe herunter, rumpel-dipumpel, auf dem Hinterkopf, hinter Christopher Robin. Es ist dies, soweit er weiß, die einzige Art, treppab zu gehen, aber manchmal hat er das GefühI, als gäbe es in Wirklichkeit noch eine andere Art, wenn er nur mal einen Augenblick lang mit dem Gerumpel aufhören und darüber nachdenken könnte. Und dann hat er das Gefühl, daß es vielleicht keine andere Art gibt.

Save your changes. Now we've got some more interesting content to work with.

1.4 Update Your "Greetings" Data Source

One last thing before we move on. We've got to update our data source to make sure the new field content gets piped through to the front end.

Go to Blueprints > Data Sources and click "Greetings". At the bottom right, under XML Output, Included Elements, select the following fields:

  • greeting-title
  • greeting-content: formatted
  • date
  • language

Save your changes. Now that our content entries are much more robust, let's see about updating the front end.

Step 2. Create a Master Layout Utility →

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