Invenzzia »

Feature requests

From Invenzzia wiki

Jump to: navigation, search

This page describes briefly various feature requests for the future releases.

Contents

XSLT-style condition syntax

In OPT, The content of the condition tag opt:if is written directly in the tag. In XSLT, both the first-choice content and the alternatives must be enclosed in subtags:

<xsl:choose>
<xsl:when test="condition">
First choice condition.
</xsl:when>
<xsl:otherwise>
Alternative.
</xsl:otherwise>
</xsl:choose>

The goal is to provide similar solution in OPT conditions (opt:if) that could look like that:

<opt:if>
<opt:when test="$test">
First choice.
</opt:when>
<opt:else>
Alternative.
</opt:else>
</opt:if>

This could be done without breaking the compatibility with the existing code. Pros:

  1. Ideal for the XSLT users.
  2. The first-choice content is stored in another tag which allows to load it from the snippet independently from other choices.

Cons:

  1. The code is too long and to complex for simpler tests.

Similar concept can be included into sections.

Estimated appearance: somewhere in 2.0 branch?

Extended filtering and escaping features

Currently, the programmer may set only one escaping function for templates. This feature request suggests adding a possibility of declaring custom expression modifiers (like e: and u:) and assigning different escaping functions for them, as well as providing the control over the process in opt:extend and opt:root.

Estimated appearance: OPT 2.1

Decoding the entities in the parts of the expressions

Currently, the entities in the OPT expressions are always decoded to their character values, so that the expression parser operates on the original values. However, this makes some things a bit annoying. For example, to create a dynamic URL with an extra parameter, we must write:

<a parse:href="$base~'&amp;amp;foo=bar'">A link</a>

The idea is to create a kind of syntax solution that allows to write:

<a parse:href="$base~'&amp;foo=bar'">A link</a>

in certain situations and processing it during the compile time.

Estimated appearance: OPT 2.1

PHP in templates

A suggestion to include the possibility of enclosing PHP code snippets in the templates:

A template...
 
<opt:php><![CDATA[
echo 'Hi universe!';
]]></opt:php>
 
A template..

Feature rejected - PHP in OPT templates is inconsistent with the project philosophy. Moreover, we would never be able to provide a satisfying support, as the PHP output generated by the compiler is undocumented and obviously will be changing between releases. opt:php is available only as an external plugin.

Personal tools