Is there a liquid markup or module tag I can use as a “value” to fill in a field for a form, that way I can identify the page URL when workflow notifications come for a product quote form?
Or would I just need to create a new custom property with the URL manually entered, to use that property as the value in the form field?
Adam, another question, what about outputting a custom web app property to use as a value on another form field? I’m using the one below for one of the custom module I created to disaply a title/name of the web app item:
name of the custom property is “ProductName” and I want it to be a value just like the URL earlier.
For some reason, it only populates this field when the form scripts are within the module layout, but when I use the form tag instead in the layout, it does not display at all inside the form field.
Yes, by default, the module properties are scoped to work inside the Layouts only.
But there are ways to pass or retrieve this data outside of the module items layout… depending on your use case.
Is your form still rendering on the same page as the Custom Module item?
and is the form below the layout markup?
Or is your form on another page and just linked to from the custom module item page?
The form tag is within the custom “post detail” layout on the same page. The form renders on a modal popup when a request for quote button is clicked (but the form tag is within the post detail layout).
I noticed when using a form (as component tag) on a detail layout of a module, the properties of the module can also be accessed like that: E.g. instead of using {{this.name}} to get the name of the module item in the form layout, use {{this.parent.name}}. Putting <pre>{{this}}</pre> in the form code will show you all the data of the module the form component is embeded in (the parent section).
Yes, very good point @TimL.
I always forget about the parent object. I think because in some cases it can be inconsistent (or at least it used to be).
But this is a very valid, and cleaner, suggestion - nice one