From: don u. <don...@ya...> - 2010-05-27 15:48:06
|
I've been looking at this, tracking code all over the place. The problem seems to be, that in the initial {{#ask query page, the function hook doAsk is called, and the results are passed along for additional wiki parsing. IE, it may return a peice of text for a result, that looks like [http://servername/image.jpg] . This is because the queryResultPrinter's getResult method, is called with the outputmode SMW_OUTPUT_WIKI. Then, farther up the stack, that will get recognized as an image, and rendered as such. On a Special:Ask, page, howerever, the processesing is different. in SMW_SpecialAsk.php, roughly line 270 (I've got too much debug code in there to be sure of exact line numbers), the queryResultPrinter's getResult method is called with outpputmode SMW_OUTPUT_HTML, which allows the links (properties of type "_uri" to get rendered as links; there's no check to see if the links are images and should be rendered as such. and the results don't go through any additional wiki parsing. So I can't just change the output mode to SMW_OUTPUT_WIKI there, unless there's a line I can insert to say "do additional wiki link parsing" When calling getResult with outputmode SMW_OUTPUT_HTML, the url ultimately gets passed through Linker->makeExternalLink . That method has a function hook call, LinkerMakeExternalLink, which makes me think maybe we could override the functionality here somehow. What do you think of that? basically, the initial query results page, and the "further results" page , are executed within very different contexts. ________________________________ From: Yaron Koren <ya...@gm...> To: don undeen <don...@ya...> Cc: smw list <sem...@li...> Sent: Wed, May 26, 2010 4:57:39 PM Subject: Re: [Semediawiki-user] Fw: "further results" of inline query to display images? That sounds like a bug in Special:Ask - it's meant to basically replicate exactly what shows up when you run inline queries in other pages, but it doesn't always. If you're willing to look into it, that would be great - all the relevant code is in /specials/SpecialAsk/SMW_SpecialAsk.php. -Yaron On Wed, May 26, 2010 at 3:46 PM, don undeen <don...@ya...> wrote: >[sorry, mean to send this to the whole list...] > > > > > >>Is that a bug or a feature? :) >>I could work on fixing that, if it's possible and desired. >>Seems to me, that if you're looking at the query results on a page, and you click "further results", the expected result would be that the results look like they're in the same format as the initial set of results. > >>But, since this is redirecting to a different page, I can see how there would be complications. > > > > >>________________________________ >>From: Jeroen De Dauw <jer...@gm...> >>To: don undeen <don...@ya...> >>Sent: Wed, May 26, 2010 1:57:04 PM >>Subject: Re: [Semediawiki-user] "further results" of inline query to display images? > >>I don't think you can do that. You can however modify the target of the 'further results' link to a page containing a query of your own design. > >>-- >>Jeroen De Dauw >>* http://blog.bn2vs.com >>* http://wiki.bn2vs.com >>Don't panic. Don't be evil. 50 72 6F 67 72 61 6D 6D 69 6E 67 20 34 20 6C 69 66 65! >-- > > > > >>On 19 May 2010 22:56, don undeen <don...@ya...> wrote: > >>> >>>Hi guys, >>>>I've got a query in my page that looks like: >>> >>> >>>>{{#ask: [[Category:Art Object]] >>>>[[-HighlightsObject::+]] >>>>[[Has family map coordinates::+]] >>>>| ?has image url >>>>| ?-HighlightsObject >>>>| ?Made by >>>>| format=table >>>>| merge=false >>>>|}} >>> >>>>the "has image url" is a uri-type property, and when the first page of results shows, each url is rendered as an image, which is what I want. >>> >>>>however, when I click on "further results" - it goes to the special:ask page, and in my results, only the image url is displayed, not the image itself. >>> >>>>Is there any way to fix this, so I see teh image itself on the Special:ask page? >>> >>>>version info: >>> >>>>MediaWiki 1.15.1 >>>>PHP 5.3.0 (apache2handler) >>>>MySQL 5.1.36-community-log Semantic MediaWiki (Version 1.5.0) >>>>SMWHalo Extension (Version 1.4.6-for-SMW-1.4.3) >>>>Semantic Result Formats (Version 1.4.6) >>> >>>>and a handful of unrelated extensions. >>> >>>>thanks for your help all, and sorry if this has been covered in the past. I couldn't find any references >>>>(btw, is there a searchable SMW-users archive?) >>>>------------------------------------------------------------------------------ >>> >>>>_______________________________________________ >>>>Semediawiki-user mailing list >>>Sem...@li... >>>https://lists.sourceforge.net/lists/listinfo/semediawiki-user >>> >>------------------------------------------------------------------------------ > >>_______________________________________________ >>Semediawiki-user mailing list >Sem...@li... >https://lists.sourceforge.net/lists/listinfo/semediawiki-user > -- WikiWorks · MediaWiki Consulting · http://wikiworks.com |