Default text

07/07/2011

It is sometimes convenient to populate variable web-to-print text fields by default. This way, users can edit parts of the text only and wont have to waste time re-entering large texts for no reason.

This web-to-print text field feature is available only when used with our web-to-print extension for Magento.

Note. You need to have web-to-print extension version 1.9.1.0beta12 or later installed for this to work. At this time, this feature is not included in the latest stable version of our extension.

Lets take advantage of this feature in a “Weekly specials” restaurant menu web-to-print template. We’ll setup variable text fields to show up auto populated with the text from the template file by default. Users will be able to

  • replace only parts of the text or the whole text all together or
  • just see the original text as a prompt that clears on click.

Creating the template

There’s nothing special regarding the template creation process. Create the variable text fields as you would in any other web-to-print template. You should only keep in mind that the placeholder text you put in the text frames will be used to auto populate the field.

Field editor

Assigning a default text option to a text field is done through the field editor. For example, our “specials” menu consists of 3 dishes, each represented by the name of the dish and its ingredients.

In the front end, we want to make:

  • the meal name show up as a prompt only and disappear on click
  • the list of ingredients show up as a populated field that the users can edit as they wish.

After uploading the template, click on a text field name to expand its field editor.

In the “Magento only features” section, choose:

  • From template, as a prompt – for the fields that should show the default text only until the user clicks on the field
  • From template, editable – for the fields that should be auto populated and offer the users the option of editing parts of the default text or the whole of it.

See the feature in action

Navigate to the corresponding product page of the template in your Magento web-to-print store to see the feature in action.

See also: