On Donnerstag, 20. Dezember 2007, Yaron Koren wrote:
> Hi,
>
> On a project I'm working on, a table generated by an #ask function lists
> image pages in one of the columns, and I wanted to display thumbnails,
> instead of image file names, in that column. Then I had the thought that
> inline queries should *always* display thumbnails for images (assuming
> linking is set to true) - after all, why would someone just want to see a
> list of image names?
>
> Anyway, below is the two-line addition to accomplish that. Feel free to add
> it in to the code - I think it would definitely be an improvement.
>
> -Yaron

Good idea. I have incorporated this code and modified it slightly: it now 
uses "frameless|border|text-top" instead of "thumb". The problem is that the 
change affects both query results *and* factbox display, and that the latter 
does not do well with the floating/clear:all behaviour of MW thumbnails. The 
change does of course not affect <ask> but only #ask.

Cheers,

Markus

>
>
> Index: includes/SMW_DV_WikiPage.php
> ===================================================================
> --- includes/SMW_DV_WikiPage.php        (revision 28671)
> +++ includes/SMW_DV_WikiPage.php        (working copy)
> @@ -88,6 +88,8 @@
>                 }
>                 if ( ($linked === NULL) || ($linked === false) ) {
>                         return $this->m_prefixedtext;
> +               } elseif ($this->m_namespace == NS_IMAGE) { // display
> thumbnail for images
> +                       return '[[' . str_replace("'", '&#x0027;',
> $this->m_prefixedtext) . '|' . $this->m_textform . '|thumb]]';
>                 } else {
>                         return '[[:' . str_replace("'", '&#x0027;',
> $this->m_prefixedtext) . '|' . $this->m_textform . ']]';
>                 }



-- 
Markus Krötzsch
Institut AIFB, Universät Karlsruhe (TH), 76128 Karlsruhe
phone +49 (0)721 608 7362        fax +49 (0)721 608 5998
[EMAIL PROTECTED]        www  http://korrekt.org

Attachment: signature.asc
Description: This is a digitally signed message part.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel

Reply via email to