Page MenuHomePhabricator

Allow template calls as field values
Closed, DeclinedPublic

Description

Author: khadjari

Description:
Think of this scenario. You have three templates {{Not Started}} {{Ongoing}} and {{Done}}.

You then create a property called "project status" that could hold the values above as allowed values.

You then create a form for "project" that will include "project status"

Now the problems.

  1. In the form where you have to set project status, instead of seeing the templates, you see their source code.
  1. When choosing one of these values, its source code is actually chosen and so the verification fails showing you a warning. If you on the other side manually write {{Not Started}} in the "Edit Source" of the page then you will have no problems and the page is shown very well.

The problem is that the semantic forms do not support templates well. If they do then Creating powerful forms become much easier.


Version: REL1_20-branch
Severity: minor

Details

Reference
bz47502

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 1:26 AM
bzimport set Reference to bz47502.

Sorry I didn't respond to this until now. One option is to have the allowed values for that field simply by "Not Started", "Ongoing" and "Done", and then have the main template call the relevant template for whichever value the user has selected, using #if.

Changing status of this to "minor".

Marking this as "wontfix" - I think it's a bad idea to treat template calls as data; and in any case, if you really want to do this, you can get it working by adding something like "values={{Not Started}}, {{Ongoing}}, {{Done}}" to the field tag.