Last modified: 2014-02-12 23:38:03 UTC
I have a form with nested templates: > {{{info}}} > {{{for template|Cache}}} > ...Cache fields... > {{{field|Locations|holds template}}} > {{{end template}}} > {{{for template|Cache/Location|multiple|embed in field=Cache[Locations]}}} > ...Location fields... > {{{end template}}} Everything works good. Page code looks as expected: > {{Cache > |...Cache fields... > |Locations={{Cache/Location|...}}{{Cache/Location|...}}... > }} I have an additional *partial* form: > {{{info|partial form}}} > {{{for template|Cache}}} > <!-- No Cache fields, just next one. --> > {{{field|Locations|holds template}}} > {{{end template}}} > {{{for template|Cache/Location}}} > ...Location fields... > {{{end template}}} After editing a page with this partial form, all the Location templates *moved* *out* of Cache, while Locations field receives strange value: > {{Cache > |...Cache fields... > |Locations=@replace_Cache___Locations@ > }} > {{Cache/Location|...}}{{Cache/Location|...}}... That's obviously a big. Partial form should not move nested templates out of main template. However, there is a workaround: removing "partial form" specifier from partial form definition. Such a "non-partial" form produces correct result, but I am a bit afraid -- formally it is declared as partial form, so it does not have to save non-used fields of main template, does it?
> formally it is declared as partial form, so it does not have to save non-used fields of main template, does it? Oops, of course it should be: formally it is NOT declared as partial form, so it does not have to save non-used fields of main template, does it?
Hi - partial forms have never really worked well, and they certainly don't work with embedded templates. My long-term plan is to get rid of them - as soon as there's support for editing sections in SF (as opposed to just templates), I think partial forms can be gotten rid of. Until then (and afterwards as well), you can definitely use "pseudo-partial" forms - regular forms that only have a small subset of the fields.