Hi,

The way to handle multiple values for the same property is to use the #arraymap parser function, defined in the Semantic Forms extension (which is already included in Referata). See here:

http://www.mediawiki.org/wiki/Extension:Semantic_Forms#Multiple_values_for_the_same_field

-Yaron


On Tue, Feb 24, 2009 at 11:44 AM, Norman Gray <norman@astro.gla.ac.uk> wrote:

Dave and all, hello.

On 2009 Feb 24, at 16:03, Dave Loomer wrote:

> use a #foreach (from
> the LoopFunctions extension) to loop through these values.  So in
> referencing the template:

Aha.  I've tried

! Narrower terms
| {{#foreach:Narrower$n$|[[Narrower::{{{Narrower$n$|}}}]]}}
|-

...but then I get the error '"" cannot be used as a page name in this
wiki'.  If I instead use {{{Narrower$n$}}}, then I get the error
'"{{{Narrower$n$}}}" cannot be used as a page name in this wiki.'.

This is with:

{{Concept
|Label=Cat
|Narrower=DomesticCat,CoolCat
|Narrower1=DomesticCat
|Narrower2=CoolCat
}}

since the LoopFunctions documentation seems to require the labels to
be unit-offset.

How would I check if the LoopFunctions extension is in fact installed
in referata?



I've tried some other more obvious things, but without success.

! Narrower term
| {{#if: {{{Narrower|}}} | [[Narrower::{{#replace:
{{{Narrower|}}}|,|]], [[Narrower::}}]] | none}}
|-
! Narrower term
| {{FormatList|Narrower|{{{Narrower|}}}}}
|-
! Narrower term
| {{#if: {{{Narrower|}}} | [[Narrower::{{{Narrower|}}}]] | none}}
|-

... where Template:FormatList is

{{#if:{{{2}}}|[[{{{1}}}::{{#explode:{{{2}}}|,}}]] ; {{FormatList|
{{{1}}}|{{#sub:{{{2}}}|{{#len:{{#explode:{{{2}}}|,}}}}+1}}}}|none}}

But the first of these produces an error '"}}" cannot be used as a
page name in this wiki' (which may be the result of a mis-parse of the
end of the #if, around '[[Narrower::}}]]' ?), and the second results
in an error 'Template loop detected' (what, I can't recurse?).

> 2. Pass the values in a delimited list as you have tried before, but
> then write your own extension to call within the Concept template
> which explodes the delimited list back into individual elements and
> then processes them accordingly.

Do you mean here what I tried with Template:FormatList, or something
more profound, involving writing a specific PHP extension (which does
seem like a damn big hammer to crack what I'd have thought was a
fairly small nut).

Best wishes,

Norman


--
Norman Gray  :  http://nxg.me.uk
Dept Physics and Astronomy, University of Leicester


------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Semediawiki-user mailing list
Semediawiki-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-user