[Inline Query] Named parameters when using result format template

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

[Inline Query] Named parameters when using result format template

planetenxin
Hi,

i'm using a template together with Semantic Forms extension. This template contains some named parameters. As far as i know, Semantic Forms requires named parameters. Everything works fine.

I'd like to reuse the same template to display results from inline queries. This does not work, because using templates as result formats of inline queries requires unnamed parameters like {{{1}}}.

Is there a way to reuse my template for both cases. I already searched the web and this forum but didn't get any idea...

/planetenxin
Reply | Threaded
Open this post in threaded view
|

Re: [Inline Query] Named parameters when using result format template

Yaron Koren
Semantic Forms, I'm pretty sure, also works with unnamed parameters like {{{1}}}, {{{2}}}, etc.

-Yaron

On Fri, Jan 16, 2009 at 9:01 AM, planetenxin <[hidden email]> wrote:

Hi,

i'm using a template together with Semantic Forms extension. This template
contains some named parameters. As far as i know, Semantic Forms requires
named parameters. Everything works fine.

I'd like to reuse the same template to display results from inline queries.
This does not work, because using templates as result formats of inline
queries requires unnamed parameters like {{{1}}}.

Is there a way to reuse my template for both cases. I already searched the
web and this forum but didn't get any idea...

/planetenxin
--
View this message in context: http://www.nabble.com/-Inline-Query--Named-parameters-when-using-result-format-template-tp21499956p21499956.html
Sent from the Semantic Mediawiki - User mailing list archive at Nabble.com.


------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user


------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|

Re: [Inline Query] Named parameters when using result format template

planetenxin
This post was updated on .
Hi Yaron,

oops, yes you're right. Maybe i've overlooked something in my previous test. Semantic Forms definitely support unnamed parameters. Also the "page name" mechanism is working. But it seems that there's an issue with the order, the parameters are saved. In the following example i have a form, where parameter {{{2}}} should be entered as first field, parameter {{{1}}} as second field:


<noinclude>
This is the 'Test' form.
To add a page with this form, enter the page name below;
if a page with that name already exists, you will be sent to a form to edit that page.

{{#forminput:Test}}

</noinclude><includeonly>

{{{info|page name=<Test[1]>_<Test[2]>}}}

{{{for template|Test}}}
{| class="formtable"
 ! width="200px" | Parameter 2:
 | {{{field|2|mandatory}}}
 |-
 ! width="200px" | Parameter 1:
 | {{{field|1}}}
|}
{{{end template}}}

{{{standard input|summary}}}
{{{standard input|minor edit}}} {{{standard input|watch}}}
{{{standard input|save}}} {{{standard input|preview}}} {{{standard input|changes}}} {{{standard input|cancel}}}
</includeonly>

As a result i'll get:
{{Test|param 2|param 1}}

Parameter 1 and Parameter 2 are swapped.

/planetenxin
Reply | Threaded
Open this post in threaded view
|

Re: [Inline Query] Named parameters when using result format template

planetenxin
In reply to this post by Yaron Koren

Hi Yaron,

oops, yes you're right. Maybe i've overlooked something in my previous test.
Semantic Forms definitely support unnamed parameters. Also the "page name"
mechanism is working. Here is my test:

<noinclude>
This is the 'Test' form.
To add a page with this form, enter the page name below;
if a page with that name already exists, you will be sent to a form to edit
that page.

{{#forminput:Test}}

</noinclude><includeonly>

{{{info|page name=<Test[1]>_<Test[2]>}}}

{{{for template|Test}}}
{| class="formtable"
! width="200px" | Parameter 1:
| {{{field|1|mandatory}}}
|-
! width="200px" | Parameter 2:
| {{{field|2}}}
|}
{{{end template}}}


{{{standard input|summary}}}

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

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


Do you know if there's a chance to get the inline queries to work with named
parameters? I'd prefer named parameters.

/planetenxin
 


Yaron Koren wrote:

>
> Semantic Forms, I'm pretty sure, also works with unnamed parameters like
> {{{1}}}, {{{2}}}, etc.
> -Yaron
>
> On Fri, Jan 16, 2009 at 9:01 AM, planetenxin <[hidden email]> wrote:
>
>>
>> Hi,
>>
>> i'm using a template together with Semantic Forms extension. This
>> template
>> contains some named parameters. As far as i know, Semantic Forms requires
>> named parameters. Everything works fine.
>>
>> I'd like to reuse the same template to display results from inline
>> queries.
>> This does not work, because using templates as result formats of inline
>> queries requires unnamed parameters like {{{1}}}.
>>
>> Is there a way to reuse my template for both cases. I already searched
>> the
>> web and this forum but didn't get any idea...
>>
>> /planetenxin
>> --
>> View this message in context:
>> http://www.nabble.com/-Inline-Query--Named-parameters-when-using-result-format-template-tp21499956p21499956.html
>> Sent from the Semantic Mediawiki - User mailing list archive at
>> Nabble.com.
>>
>>
>>
>> ------------------------------------------------------------------------------
>> This SF.net email is sponsored by:
>> SourcForge Community
>> SourceForge wants to tell your story.
>> http://p.sf.net/sfu/sf-spreadtheword
>> _______________________________________________
>> Semediawiki-user mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by:
> SourcForge Community
> SourceForge wants to tell your story.
> http://p.sf.net/sfu/sf-spreadtheword
> _______________________________________________
> Semediawiki-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>
>

--
View this message in context: http://www.nabble.com/-Inline-Query--Named-parameters-when-using-result-format-template-tp21499956p21502670.html
Sent from the Semantic Mediawiki - User mailing list archive at Nabble.com.


------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user