CASE: when to use placeholder or default?

When you create a custom object, you’ll have the option to add the following tags:


{% input custom.the_namespace.the_key placeholder:"enter name here" %}

This guides the user what to do with the object (to fill it with a name):

The “enter name here” will never be displayed too in an export. So if you don’t fill a value in the object, nothing will be displayed in the export. You could say the placeholder-tag has only use for input-mode.


{% input custom.the_namespace.the_key default:"Michael Jordan" %}

This tag is meant for the output-mode. In input-mode the value will also be displayed (so the user doesn’t have to fill it in), but in export that value will also be shown:





:warning: Beware though! A default-tag never will fill the object with the default. So in this example the object custom.the_namespace.the_key is empty! But, in export it will show something. Very important to understand this matter
The reason for this, is that an input is only made possible by Silverfin; in standard Liquid (Shopify made this) this isn’t even possible. Only when you actually put something in the object, the object will no longer be empty (and a default-tag doesn’t fill the object at all!) :warning:

If any questions, plz shoot

1 Like