The value will be passed to the template in a parameter called {{{userparam}}}, 
if I recall correctly (I now I use that somewhere on my site, but can't seem to 
find it atm).
Best regardsLeo

Leonard Wallentin
leo_wallen...@hotmail.com
+46 (0)735-933 543http://säsongsmat.nu

http://nairobikoll.se/
http://twitter.com/leo_wallentin
Skype: leo_wallentin


Date: Thu, 10 Nov 2011 10:25:02 +0100
From: j...@saruman.biz
To: semediawiki-devel@lists.sourceforge.net
Subject: [SMW-devel] How to use "userparam" in template calls?


  



    
  
  
    Hey,

    On help page http://semantic-mediawiki.org/wiki/Help:Template_format
    it's mentioned:

         Parameter "userparam" - Type "text" - default "empty" -
      description "A value passed into each template call, if a template
      is used "

    Unfortunately there is no example of its usage in the SMW
    documentation (as far as I've seen).

    

    Can a developer check the code and explain to me how to use
    userparam? Noone on the user list seems to know, and while I find
    the string "userparam" in queryprinters SMW_QP_Category.php and
    SMW_QP_List.php  (and in languages/SMW_Messages.php) I cannot read
    the code :-( 

    

    I have tried to use it as shown below, but I get results that do not
    include any userparam provided.

    

    I tried creating Template:Test that simply prints {{{1|empty}}}
      {{{2|empty}}} {{{3|empty}}}, and then called it like this

       {{#ask: 
<selection>|format=template|template=test|link=none|userparam=bla}}
    The result looks something like

       <pagename1> empty empty
   <pagename2> empty empty
    while I would expect (or hope) to see

       <pagename1> bla empty
   <pagename2> bla empty
    or maybe

       bla <pagename1> empty
   bla <pagename2> empty
    in other words: the string provided in userparam doesn't show up in
    the template.

    Thanks,
    

    -- 

    Jan "Saruman!" S.
    

    "I'm a stream of noughts and crosses in your R.A.M."
    

  


------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel                  
                  
------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel

Reply via email to