[bug] Template parsing: tokens of empty optional fields aren't removed #2

Closed
lolmaus opened this Issue Feb 10, 2010 · 2 comments

Comments

Projects
None yet
2 participants
@lolmaus

lolmaus commented Feb 10, 2010

How to reproduce

  1. Create a bureaucracy form with an optional field.
  2. Create a template page for the bureaucracy form. Add a @@token@@ corresponding to the optional field.
  3. Submit the form with the optional field left empty.

What happens

The token is not replaced. It gets his way into the resulting page making it look messy.

What should happen

Tokens should be replaced with their corresponding field values. When a field is empty, its token should be replaced with emptiness, i. e. be removed.

@samwilson

This comment has been minimized.

Show comment Hide comment
@samwilson

samwilson Mar 13, 2012

From the manual:

You may follow the field name with a pipe | char and a default value, should the user not have filled in an optional field.

So you just need to use @@Token|@@ in your template.

From the manual:

You may follow the field name with a pipe | char and a default value, should the user not have filled in an optional field.

So you just need to use @@Token|@@ in your template.

@lolmaus

This comment has been minimized.

Show comment Hide comment
@lolmaus

lolmaus Mar 13, 2012

Yay!

lolmaus commented Mar 13, 2012

Yay!

@lolmaus lolmaus closed this Mar 13, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment