instances within instances within instances

3 views
Skip to first unread message

Andy Brooks

unread,
Aug 26, 2008, 11:54:53 AM8/26/08
to Semantic Forms
Hi, I want to put a multiple instance form within a multiple instance
form, like this:

{{{for template|Participants|label=Add Participants to Match|
multiple}}}
Ring Name:{{{field|ring_name|autocomplete on property=ring_name}}}
{{{for template|Moves|label=Add Signature Moves to Participant|
multiple}}}
Signature Moves:{{{field|sig_moves|}}}
Random Other Field:{{{field|rndm_field|}}}
{{{end template}}}
{{{end template}}}

It's not working though. Is there a work around?

Thanks,
Andy

Yaron Koren

unread,
Aug 26, 2008, 4:26:27 PM8/26/08
to semanti...@googlegroups.com
Hi,

Three things about this data design seem a bit convoluted to me: first is that each participant in this match has their own "ring name" - wouldn't there be a single ring name for the whole match? The second is that the data on each participant's signature moves is contained on the page for a match, not in that own participant's page - this would seem to create a lot of repeated data, if a person participates in many matches. Finally, I don't understand the "random field" concept - is that supposed to be a free-text field? It seems to me that moving the "moves" information to participants' own pages would clear up a lot of these issues.

-Yaron

Andy Brooks

unread,
Aug 26, 2008, 5:57:11 PM8/26/08
to Semantic Forms
Sorry for the bad fields, they were just thrown in there for the
example. Here's how I really want to set it up:

>>Wrestling Event
>>>>Match
>>>>>>Participant (Referee)
>>>>>>Participant (Wrestler)
>>>>>>Participant (Wrestler)
>>>>>>Participant (Manager)
>>>>Match
>>>>>>Participant (Referee)
>>>>>>Participant (Wrestler)
>>>>>>Participant (Wrestler)
>>>>Match
>>>>>>Participant (Referee)
>>>>>>Participant (Wrestler)
>>>>>>Participant (Wrestler)
>>>>>>Participant (Manager)
>>>>>>Participant (Wrestler)
>>>>>>Participant (Wrestler)

Since there is no standard amount of matches to an event, the "add
another" function works quite well. However, the same is true for
participants in a match -- some matches only feature 2 people or some
might feature over 30. Once a user has added a match, I want them to
be able to add participants to that match.

-Andy

On Aug 26, 1:26 pm, "Yaron Koren" <yaro...@gmail.com> wrote:
> Hi,
>
> Three things about this data design seem a bit convoluted to me: first is
> that each participant in this match has their own "ring name" - wouldn't
> there be a single ring name for the whole match? The second is that the data
> on each participant's signature moves is contained on the page for a match,
> not in that own participant's page - this would seem to create a lot of
> repeated data, if a person participates in many matches. Finally, I don't
> understand the "random field" concept - is that supposed to be a free-text
> field? It seems to me that moving the "moves" information to participants'
> own pages would clear up a lot of these issues.
>
> -Yaron
>

Yaron Koren

unread,
Aug 26, 2008, 10:46:48 PM8/26/08
to semanti...@googlegroups.com
Ah, I see. Well, there's no way to have a form embed templates within other templates. There are various approaches to this, although I would really recommend having separate pages for each "match" - that way, semantic properties pointing to participants and other match data will indicate the right thing, and will be queriable.

-Yaron

Daniel Friesen

unread,
Aug 27, 2008, 12:07:51 AM8/27/08
to semanti...@googlegroups.com
Though, you have to admit. Nested templates is a decent feature we could consider offering in the future. Same with alternating templates.

ie: you have Template A B C and D. A goes at the start, D goes at the end. But B and C go in the middle but are 0 or more types and rather than having b's then c's, they can me mixed..

A - B - C - D
A - B - D
A - C - D
A - C - B - D
A - B - C - B - B - C - D
or whatever...

From what I remember there is no way to do this currently... and it does have some use...

Infobox start
Infobox row
Infobox row
Infobox box (like a related collapsible box)
Infobox row
Infobox box
Infobox end

~Daniel Friesen(Dantman, Nadir-Seen-Fire) of:
-The Nadir-Point Group (http://nadir-point.com)
--It's Wiki-Tools subgroup (http://wiki-tools.com)
--The ElectronicMe project (http://electronic-me.org)
--Games-G.P.S. (http://ggps.org)
-And Wikia ACG on Wikia.com (http://wikia.com/wiki/Wikia_ACG)
--Animepedia (http://anime.wikia.com)
--Narutopedia (http://naruto.wikia.com)

Yaron Koren

unread,
Aug 27, 2008, 10:49:40 AM8/27/08
to semanti...@googlegroups.com
Well, nested templates and alternating templates are two separate discussions. For nested templates, I don't see much of a need, especially until SMW offers support for sub-objects in a page (i.e., true n-ary relations), and maybe not even afterwards. I similarly haven't seen a real need for alternating templates, although I'm always open to hearing about specific cases where they could be helpful.

-Yaron

Chuwiey

unread,
Aug 27, 2008, 12:21:48 PM8/27/08
to Semantic Forms
About nested templates (and a possible alternative solution):
for instance if you wanted to create an faq setup, and have multiple
answers relate to a certain question... like so:
Question: Why did the chicken cross the road?
Answer #1: To get to the other side
Answer #2: To see the dark knight
and so on...

right now you would need to have a template for questions and a
multiple instance-template for the answers... which is fine, however,
it does make it necessary to use separate templates for the answer
field and the question field... so why not instead of having the "add
another" function only exist for multiple instance templates, add it
to certain fields.. and upon save just merge those with a separating
character and send that just like the usual multiple valued fields?
(creating an array property) that way you could also query for the
questions and their answers easier...

-Chuwiey

On Aug 27, 10:49 am, "Yaron Koren" <yaro...@gmail.com> wrote:
> Well, nested templates and alternating templates are two separate
> discussions. For nested templates, I don't see much of a need, especially
> until SMW offers support for sub-objects in a page (i.e., true n-ary
> relations), and maybe not even afterwards. I similarly haven't seen a real
> need for alternating templates, although I'm always open to hearing about
> specific cases where they could be helpful.
>
> -Yaron
>
> On Wed, Aug 27, 2008 at 12:07 AM, Daniel Friesen
> <nadir.seen.f...@gmail.com>wrote:
> > On Aug 26, 1:26 pm, "Yaron Koren" <yaro...@gmail.com> <yaro...@gmail.com> wrote:
>
> >  Hi,
>
> > Three things about this data design seem a bit convoluted to me: first is
> > that each participant in this match has their own "ring name" - wouldn't
> > there be a single ring name for the whole match? The second is that the
>
> >  data
>
> >  on each participant's signature moves is contained on the page for a
>
> >  match,
>
> >  not in that own participant's page - this would seem to create a lot of
> > repeated data, if a person participates in many matches. Finally, I don't
> > understand the "random field" concept - is that supposed to be a
>
> >  free-text
>
> >  field? It seems to me that moving the "moves" information to
>
> >  participants'
>
> >  own pages would clear up a lot of these issues.
>
> > -Yaron
>
> > On Tue, Aug 26, 2008 at 11:54 AM, Andy Brooks <ajbro...@gmail.com> <ajbro...@gmail.com>

Guoqian Jiang

unread,
Aug 27, 2008, 12:59:09 PM8/27/08
to semanti...@googlegroups.com

I would like to describe a use case that might be related to a nested form feature.
 
We have a template [[Template: Definition]] that has two fields. The first one {{{1}}} is assigned as the textual value of [[Property:definition]] and second field {{{2}}} is used to capture web url as reference. We would like to make the second field multiple. In that way, user can attach zero to many reference urls to this definition. Is this possible in current SF?
 
Thanks,
 
-Guoqian





Date: Wed, 27 Aug 2008 10:49:40 -0400
From: yar...@gmail.com
To: semanti...@googlegroups.com
Subject: [Semantic Forms] Re: instances within instances within instances

Chuwiey

unread,
Aug 27, 2008, 1:21:43 PM8/27/08
to Semantic Forms
Yes that is possible with a multiple value field, however, it isn't
visually appealing since the one field would have to have all the urls
with a delimiter in it... that's why i suggested to make a more
visually appealing multiple valued field... making the add another
button work for a field as well would allow for a certain fields to be
a bit more visually appealing while not changing too much
functionality.. this option could remain as a choice between a comma
delimited mv (multiple value) or a "add another" mv...

-Chuwiey

On Aug 27, 12:59 pm, Guoqian Jiang <gqji...@hotmail.com> wrote:
> I would like to describe a use case that might be related to a nested form feature.
>
> We have a template [[Template: Definition]] that has two fields. The first one {{{1}}} is assigned as the textual value of [[Property:definition]] and second field {{{2}}} is used to capture web url as reference. We would like to make the second field multiple. In that way, user can attach zero to many reference urls to this definition. Is this possible in current SF?
>
> Thanks,
>
> -Guoqian
>
> Date: Wed, 27 Aug 2008 10:49:40 -0400From: yaro...@gmail.comTo: semantic-fo...@googlegroups.comSubject: [Semantic Forms] Re: instances within instances within instances
> Well, nested templates and alternating templates are two separate discussions. For nested templates, I don't see much of a need, especially until SMW offers support for sub-objects in a page (i.e., true n-ary relations), and maybe not even afterwards. I similarly haven't seen a real need for alternating templates, although I'm always open to hearing about specific cases where they could be helpful.-Yaron
>
> On Wed, Aug 27, 2008 at 12:07 AM, Daniel Friesen <nadir.seen.f...@gmail.com> wrote:
>
> Though, you have to admit. Nested templates is a decent feature we could consider offering in the future. Same with alternating templates.ie: you have Template A B C and D. A goes at the start, D goes at the end. But B and C go in the middle but are 0 or more types and rather than having b's then c's, they can me mixed..A - B - C - DA - B - DA - C - DA - C - B - DA - B - C - B - B - C - Dor whatever...From what I remember there is no way to do this currently... and it does have some use...Infobox startInfobox rowInfobox rowInfobox box (like a related collapsible box)Infobox rowInfobox boxInfobox end~Daniel Friesen(Dantman, Nadir-Seen-Fire) of:
> -The Nadir-Point Group (http://nadir-point.com)
> --It's Wiki-Tools subgroup (http://wiki-tools.com)
> --The ElectronicMe project (http://electronic-me.org)
> --Games-G.P.S. (http://ggps.org)
> -And Wikia ACG on Wikia.com (http://wikia.com/wiki/Wikia_ACG)
> --Animepedia (http://anime.wikia.com)
> --Narutopedia (http://naruto.wikia.com)
>
> Yaron Koren wrote:
>
> Ah, I see. Well, there's no way to have a form embed templates within other
> templates. There are various approaches to this, although I would really
> recommend having separate pages for each "match" - that way, semantic
> properties pointing to participants and other match data will indicate the
> right thing, and will be queriable.
>
> -Yaron
>

Yaron Koren

unread,
Aug 27, 2008, 3:31:10 PM8/27/08
to semanti...@googlegroups.com
That's an interesting idea... did you suggest that before? I don't remember that.

In response to the previous example, of a form used to create a questions-and-answers page, that's what I mean when I say that nested or alternating templates could become more of a pressing concern when true n-ary relations are supported. Currently, you can't use semantic properties to tie an answer or a set of answers to a specific question, if there's more than one question on the page. So I'd say you'd be better off either having one question per page, or just having all the questions and answers done as free text, without bothering with templates and forms. It would give more flexibility, without losing much in terms of functionality.

-Yaron

Chuwiey

unread,
Aug 28, 2008, 10:02:18 AM8/28/08
to Semantic Forms
I don't think I suggested it before.. It should be fairly simple to
implement...

Side note: I would like to finish up merging popups to SF, I could use
some help with the javascript if possible, but the php stuff is
done...

as for questions and answers... n-ary would definitely help... for
now, I solved the problem by using the pagename feature to create a
page with the name of the question...

-Chuwiey

On Aug 27, 3:31 pm, "Yaron Koren" <yaro...@gmail.com> wrote:
> That's an interesting idea... did you suggest that before? I don't remember
> that.
>
> In response to the previous example, of a form used to create a
> questions-and-answers page, that's what I mean when I say that nested or
> alternating templates could become more of a pressing concern when true
> n-ary relations are supported. Currently, you can't use semantic properties
> to tie an answer or a set of answers to a specific question, if there's more
> than one question on the page. So I'd say you'd be better off either having
> one question per page, or just having all the questions and answers done as
> free text, without bothering with templates and forms. It would give more
> flexibility, without losing much in terms of functionality.
>
> -Yaron
>

naught101

unread,
Aug 29, 2008, 2:06:30 AM8/29/08
to Semantic Forms
I've skipped a bit of the above conversation, but what you're
describing sounds very similar to what I use on my site. I have pages
for environment groups, which use a semantic template. In one of the
fields, "campaigns", I use a sub-semantic-template in which people can
list up to 20 campaigns for a group, and each of these is put into a
separate [[Has campaign::]] property. It works quite well, but it
doesn't work with semantic forms.

A possible work around for me would be to just chuck the sub-semantic-
template in as the default value for the field, and let the user work
it out, but I tried "{{{field|campagins|default={{GroupCampaigns|
environment|campaign2|...}}}}}" and it doesn't work - the template
screws up the field at the first | symbol. I also tried it with quotes
and <nowiki>, but it didn't work.

Ideally, it would be great to be able to replace a textfield with
another template.

An example of how the template works is on
http://en.envirowiki.info/Hunter_Community_Environment_Centre - you
can find both the templates used if you edit the page.

cheers
ned

On Aug 28, 2:21 am, Chuwiey <bredt...@gmail.com> wrote:
> Yes that is possible with a multiple value field, however, it isn't
> visually appealing since the one field would have to have all the urls
> with a delimiter in it... that's why i suggested to make a more
> visually appealing multiple valued field... making the add another
> button work for a field as well would allow for a certain fields to be
> a bit more visually appealing while not changing too much
> functionality.. this option could remain as a choice between a comma
> delimited mv (multiple value) or a "add another" mv...
>
> -Chuwiey
>
> On Aug 27, 12:59 pm, Guoqian Jiang <gqji...@hotmail.com> wrote:
>
> > I would like to describe a use case that might be related to anestedform feature.
>
> > We have a template [[Template: Definition]] that has two fields. The first one {{{1}}} is assigned as the textual value of [[Property:definition]] and second field {{{2}}} is used to capture web url as reference. We would like to make the second field multiple. In that way, user can attach zero to many reference urls to this definition. Is this possible in current SF?
>
> > Thanks,
>
> > -Guoqian
>
> > Date: Wed, 27 Aug 2008 10:49:40 -0400From: yaro...@gmail.comTo: semantic-fo...@googlegroups.comSubject: [Semantic Forms] Re: instances within instances within instances
> > Well,nestedtemplatesand alternatingtemplatesare two separate discussions. Fornestedtemplates, I don't see much of a need, especially until SMW offers support for sub-objects in a page (i.e., true n-ary relations), and maybe not even afterwards. I similarly haven't seen a real need for alternatingtemplates, although I'm always open to hearing about specific cases where they could be helpful.-Yaron
>
> > On Wed, Aug 27, 2008 at 12:07 AM, Daniel Friesen <nadir.seen.f...@gmail.com> wrote:
>
> > Though, you have to admit.Nestedtemplatesis a decent feature we could consider offering in the future. Same with alternatingtemplates.ie: you have Template A B C and D. A goes at the start, D goes at the end. But B and C go in the middle but are 0 or more types and rather than having b's then c's, they can me mixed..A - B - C - DA - B - DA - C - DA - C - B - DA - B - C - B - B - C - Dor whatever...From what I remember there is no way to do this currently... and it does have some use...Infobox startInfobox rowInfobox rowInfobox box (like a related collapsible box)Infobox rowInfobox boxInfobox end~Daniel Friesen(Dantman, Nadir-Seen-Fire) of:
> > -The Nadir-Point Group (http://nadir-point.com)
> > --It's Wiki-Tools subgroup (http://wiki-tools.com)
> > --The ElectronicMe project (http://electronic-me.org)
> > --Games-G.P.S. (http://ggps.org)
> > -And Wikia ACG on Wikia.com (http://wikia.com/wiki/Wikia_ACG)
> > --Animepedia (http://anime.wikia.com)
> > --Narutopedia (http://naruto.wikia.com)
>
> > Yaron Koren wrote:
>
> > Ah, I see. Well, there's no way to have a form embedtemplateswithin other

Yaron Koren

unread,
Aug 29, 2008, 8:39:13 AM8/29/08
to semanti...@googlegroups.com
Hi,

Well, you could use #arraymap to map the "Has campaign" property onto a list of values - that's the standard Semantic Forms way of handling it, and it allows any number of values; see the documentation.

-Yaron
Reply all
Reply to author
Forward
0 new messages