This project is read-only.
1
Vote

Add support for optional sections in the HTML template

description

When using the HTML template system, there are often pieces of the template which should only be included if the item actually has a specific value. When the item doesn't have that value, then those pieces should be omitted. For example, you may want to include the following substitution: "<h1>Account Number: {account number}</h1>". This works fine when the "account number" facet is defined, but would leave an empty "Account Number: " label in the template should that facet be undefined.

This feature would avoid this problem by allowing you to specify that some portions before and after a replacement should only be included if the replacement had a value. This syntax would be to include an extra pair of curly braces around the replacement; any text which appears between the outer braces would only be included if the replacement had a value.

Continuing with the previous example, you might include: "{<h1>Account Number: {account number}</h1>}" in your template. For any given item, the whole expression would be included if "account number" is defined, and the whole expression would be omitted if not.

comments