Page MenuHomePhabricator

Parameter "holds template" is incompatible on templates with "multiple"
Closed, DeclinedPublic

Description

Author: tafinho

Description:
If a template is meant to embedd a template with "Holds template" and "embed in field", then it cannot be a multiple use template, as the browser will never show the embedded template.

This also means that it is impossible to create a multi level tree form, which would be extremelly interesting

The following code should in theory works, but demonstrates the behaviour.

<noinclude>

</noinclude><includeonly>

{{{for template|Group|multiple|label=Group}}}
'''Test'''
'''HDD1:''' {{{field|HDD1|holds template}}}
{{{end template}}}

{{{for template|HDD|embed in field=Group[HDD1]}}}
'''Test'''
'''Type:''' {{{field|Type}}}
'''Type2:''' {{{field|Type2}}}

{{{end template}}}

'''Text:'''

{{{standard input|free text|rows=10}}}

{{{standard input|summary}}}

{{{standard input|minor edit}}} {{{standard input|watch}}}

{{{standard input|save}}} {{{standard input|preview}}} {{{standard input|changes}}} {{{standard input|cancel}}}
</includeonly>


Version: unspecified
Severity: enhancement

Details

Reference
bz43824

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 1:33 AM
bzimport set Reference to bz43824.

Hi - this doesn't surprise me, since I don't think combining "holds template" with "multiple" makes sense. How will the form know which instance of template A it should add each instance of template B to?

tafinho wrote:

Hi,

After awhile I gave up trying just because I got to the same conclusion as you, and that a problem realy exists.

However, my problem is not "Why" it doesn't work, but how to get how to get it to work. My end goal is, if possible, to create multi level form, in a tree.

Well, let me re-ask my question, then: how is the form supposed to decide which instance of B goes into which instance of A?

tafinho wrote:

I think i'm not gettin to your point.

Taking your example from somewhere, should be similar to the following

{{Person
...

Places lived={{Place livedlocation={{location...}}}}{{Place livedlocation={{location...}}}}{{Place livedlocation={{location...}}}}
Companies worked at={{Company worked at...}}{{Company worked at...}}

...
}}

if you can embed one template onto another, doing it recursively should be possible right?
Or am I missing something?

Oh, I see - you want one "location" template in every "Place lived" template. (In other words, one instance of B for every instance of A.) That's not possible - but if that's all you want to do, why bother with a "location" template at all; why not just pass all the fields in directly to "Place lived"?

tafinho wrote:

(In reply to comment #5)

Oh, I see - you want one "location" template in every "Place lived" template.
(In other words, one instance of B for every instance of A.) That's not
possible - but if that's all you want to do, why bother with a "location"
template at all; why not just pass all the fields in directly to "Place
lived"?

Hi,

Because I'd like to scale it horizontaly and vertically, for a tree structure:

{{class
...

subclass var={{subclassvar1={{subsubclassvar2={{subsubsubclass}}{{subsubsubclass}}{{subsubsubclass}}}}{{subsubclassvar2={{subsubsubclass}}}}

Or from the tree perspective (not really equal as above):

Class

|
|-> Subclass
|    |
|    |-> Subsubclass
|    |
|    |-> Subsubclass
|
|-> Subclass
|
|-> Subclass

The problem is that my goal is to make all subclasses anonymous, inside the same object/page, otherwise I could simply create new pages.

Right?

Okay - that's a rather different structure from the example you gave before. But I have no plans to have SF handle that level of complexity. Plus, SMW can't store more than two levels of data anyway.

tafinho wrote:

Understood.
I need to study SMW a little further before going deeper on this.