Forum
Shop Master Template - add list from members app
I'm adding some new fields to the shop master template for products (product.html).
I wanted to add a field where you can enter a members' email and ideally from a list. I noticed that this was possible when entering the category as follows (this gives a pull down of available categories) -
<perch:categories id="category" set="products" label="Category">
<perch:category id="catTitle" />
</perch:categories>
but couldn't work out how to do the same with selecting a members email. I tried the following code but this didn't put anything in the control panel
<perch:members id="targetMemberEmail" label="Select target member">
<perch:member id="email" />
</perch:members>
Is it possible?
Thanks, Ben
It's not possible as it stands, no. That functionality would need to be implemented in the Members app, or in an add-on extending the Members app.
OK - thanks - that makes sense.
A slightly unrelated question and please forgive my ignorance.
The first code example - with the categories - how does perch know to save that information in the shop app and allow it to be entered in the control panel for the shop app even though it's told that the category app should handle it.
Again, forgive my stupidity.
Thanks, Ben
The Categories app is handling the field - it's showing all the available categories and enabling you to pick from them. But then it returns the result to the Shop app, because that's the context you're editing in.
There's nothing that would stop the Members app (or any other app) providing that functionality too. In API terms, it's the pairing of a field type (for editing) and a template handler (for displaying the result on the web page).