Multiple instance templates

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Multiple instance templates

Anna Maxted
Hi team

I want to have templates set as multiple in semantic forms, so the users can 'add another'.  

I also need to be able to pull reports or queries on these, my issue is that when they choose add another all entries go into the one property, and when we pull the query it seperates the entries by commas.  Often the users put in commas in the fields, so it's really hard to distinguish between each seperate entry.

Is there any way of having each extra entry stored in a seperate property?


Appreciate your assistance!

Thanks Anna
Reply | Threaded
Open this post in threaded view
|

Re: Multiple instance templates

Eric_
Sounds like subobjects could be a solution.

https://semantic-mediawiki.org/wiki/Help:Adding_subobjects

Reply | Threaded
Open this post in threaded view
|

Re: Multiple instance templates

Ralf Krüdewagen
In reply to this post by Anna Maxted
Hi Anna,

Am Mittwoch, 24. September 2014, 20:01:57 schrieb Anna Maxted:
> Hi team
>
> I want to have templates set as multiple in semantic forms, so the users can
> 'add another'.

Well, then you can just use it as described here:
https://www.mediawiki.org/wiki/Extension:Semantic_Forms/Defining_forms#Multiple-instance_templates

As Eric said, you need to use subobjects.

A sample set of form and templates can be found for example here:
https://www.kruedewagen.de/wiki/Websites

> I also need to be able to pull reports or queries on these, my issue is that
> when they choose add another all entries go into the one property, and when
> we pull the query it seperates the entries by commas.  Often the users put
> in commas in the fields, so it's really hard to distinguish between each
> seperate entry.
>
> Is there any way of having each extra entry stored in a seperate property?

Don't know is this is exactly what you need, but I guess #arraymap is what you
need:
https://www.mediawiki.org/wiki/Extension:Semantic_Forms/Semantic_Forms_and_templates#Multiple_values_for_the_same_field

However, each value is added to the same property.

Example:
https://www.kruedewagen.de/wiki/Template:Glossary

Cheers
Ralf

> Appreciate your assistance!
>
> Thanks Anna
>
>
>
> --
> View this message in context:
> http://wikimedia.7.x6.nabble.com/Multiple-instance-templates-tp5036760.html
> Sent from the Semantic Mediawiki - User mailing list archive at Nabble.com.
>
> ----------------------------------------------------------------------------
> -- Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
> Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
> Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
> Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
> http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
> _______________________________________________
> Semediawiki-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/semediawiki-user

--


------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|

Re: Multiple instance templates

Anna Maxted
Thanks Eric and Ralf

It does seam that Subobjects may be the answer i'm looking for, but i'm struggling to really understand how to use it.

Is there any english examples someone can point me to?


What I have is this:

In the form:
{{{for template|Observations|multiple|label=Observations}}}
{{{field|Observation completed by:}}}
{{{field|Observation completed detail:|size=20}}}
{{{field|Result:}}}
{{{end template}}}

In the template
[[AUCK CT::{{{Observation completed by:|}}}]]
[[ObDetail::{{{Observation completed detail:|}}}]]
[[Casual Observation Result::{{{Result:|}}}]]


So everytime Someone adds a new lot of this information I want to see it stored in the properties seperately.  Does that make sense?
Reply | Threaded
Open this post in threaded view
|

Re: Multiple instance templates

Cavila Contrafibularity
Hi Anna,

In the form:

{{{for template|Observations|multiple|label=Observations}}}
{{{field|Observation completed by|list|delimiter=;}}}
{{{field|Observation completed detail:|size=20|list|delimiter=;}}}
{{{field|Result|list|delimiter=;}}}
{{{end template}}}

In the template:

* Observation completed by: {{{Observation completed by|}}}
* Observation completed detail: {{{Observation completed detail|}}}
* Result: {{{Result|}}}{{#subobject:-
|AUCK CT={{{Observation completed by|}}}|+sep=;
|ObDetail={{{Observation completed detail|}}}|+sep=;
|Casual Observation Result={{{Result|}}}|+sep=;
}}

In this scenario a semi-colon rather than a comma has been used to delimit values. Note that it may not always be the best alternative though (as I found out the hard way, e.g. when you need to use the HTML equivalent of square brackets). Simply replace each semi-colon if you prefer something else.

Hope that helps,

Cav

> Date: Thu, 2 Oct 2014 19:59:45 -0700
> From: [hidden email]
> To: [hidden email]
> Subject: Re: [Semediawiki-user] Multiple instance templates
>
> Thanks Eric and Ralf
>
> It does seam that Subobjects may be the answer i'm looking for, but i'm
> struggling to really understand how to use it.
>
> Is there any english examples someone can point me to?
>
>
> What I have is this:
>
> In the form:
>
>
> In the template
>
>
>
> So everytime Someone adds a new lot of this information I want to see it
> stored in the properties seperately.  Does that make sense?
>
>
>
> --
> View this message in context: http://wikimedia.7.x6.nabble.com/Multiple-instance-templates-tp5036760p5037136.html
> Sent from the Semantic Mediawiki - User mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
> Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
> Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
> Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
> http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
> _______________________________________________
> Semediawiki-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
     
------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user