From: Jason Z. <jas...@gm...> - 2009-02-04 00:55:48
|
Thanks Rob, Before I asked for help, I have tried the arraymap with the exact syntax as you mentioned. It does not work. The parser interprets the template in its own order. I tried the arrayamptemplate a moment ago. All I got is the following information: The part "|" of the query was not understood. Results might not be as expected. The part "?Label" of the query was not understood. Results might not be as expected. The part "|" of the query was not understood. Results might not be as expected. The part "?Label1" of the query was not understood. Results might not be as expected. The part "|" of the query was not understood. Results might not be as expected. The part "?Label2" of the query was not understood. Results might not be as expected. It is as same as I got while using arraymap. Jason On Tue, Feb 3, 2009 at 5:04 PM, Rob Challen <rjc...@gm...> wrote: > If you have semantic forms installed you could try using arraymap to > convert the comma seperated list to an appropriate form for generating the > query but you need to escape the pipe character in the query. Try > > Template:testTpl > {{#ask: [[{{{query}}}]] > {{#arraymap:{{{properties}}}|,|@@||?@@|}} > }} > > Or > > Template:testTpl > {{#ask: [[{{{query}}}]] > {{#arraymaptemplate:{{{properties}}}|querypart|,|}} > }} > > with: > > Template:querypart > |?{{{1}}} > > I haven;t tested it though and it depends on the parser doing it all in the > right order which I can never predict. > > Rob. > > However, I need to create a query which may consist of up to 20 properties > for display. For sure, your solution is still valid. I am wondering whether > there is a more elegant way to create the query. > > Jason > > On Mon, Feb 2, 2009 at 4:26 PM, Rolf Lampa [RIL] <rol...@ri... > >wrote: > > > Jason Zou wrote: > > > >> What I am trying to do is to pass one or more properties into an inline > >> query. For example, I have a template testTpl which accepts the > following > >> > >> {{testTpl > >> |query=test > >> |properties=property1 > >> }} > >> > >> or > >> {{testTpl > >> |query=test > >> |properties=property1, property2, property3 > >> }} > >> > >> And the testTpl is to form query as following: > >> {{#ask: [[query]] > >> |?property1 > >> ... > >> }} > >> > >> or > >> {{#ask: [[query]] > >> |?property1 > >> |?property2 > >> |?property3 > >> ... > >> }} > >> > >> Could this be done? > > > > ------------------------------------------------------------------------------ > Create and Deploy Rich Internet Apps outside the browser with > Adobe(R)AIR(TM) > software. With Adobe AIR, Ajax developers can use existing skills and code > to > build responsive, highly engaging applications that combine the power of > local > resources and data with the reach of the web. Download the Adobe AIR SDK > and > Ajax docs to start building applications today- > http://p.sf.net/sfu/adobe-com > _______________________________________________ > Semediawiki-user mailing list > Sem...@li... > https://lists.sourceforge.net/lists/listinfo/semediawiki-user > > |