A while back, Clemente, Bernadette E. wrote:
> I’d like to display a text label with its associated external link as a 
> property in the result of an #ask query. For example, I’d like to see 
> _Bernadette_ instead of  http://info.ldapserver.org 
> /whatever/Bernadette.  I used the Tablerow and Homepage templates on the 
> http://semanticweb.org/ site and was successful in duplicating the 
> contact boxes but was not able to see the same information as part of an 
> #ask. What am I missing?

(It seems no one replied...)

You have very little control over property display in query results (so 
vote early and often for 
https://bugzilla.wikimedia.org/show_bug.cgi?id=15541 ).  So you'll 
probably have to use
   format=template | template=My-special-display
in your query results, and make Template:My-special-display that adjusts 
the appearance of the various values it's passed.  See 
<http://semantic-mediawiki.org/wiki/Help:Inline_queries#Using_templates_for_custom_formatting>

(The sad strange thing is this template you use to present query results 
nicely will probably not be able to share anything with the template you 
use to display the property values nicely while setting them.)

So, if you're storing the property as "Bernadette" and it's the third 
"column" passed to template=Person-display-tabular , you would do 
something like
   [http://info.ldapserver.org/whatever/{{{3}}} {{{3}}}]

If you're storing the property as 
http://info.ldapserver.org/whatever/Bernadette , then you can use string 
parser functions to trim down what is displayed, like
   [{{{3}}} {{#replace:{{{3}}}|http://info.ldapserver.org/whatever/ |}}]

If you're trying to fiddle with pages and URLs, you should probably pass 
the option |link=none to #ask , otherwise, pages and URLs will already 
have been wrapped in square brackets by SMW.

If there might be more than one value of the property, you'll probably 
end up needing the #arraymap parser function from the Semantic Forms 
extension so you can control the display of each value.

http://wiki.laptop.org/go/Releases-test#Templated_query shows an example 
of a query results template.


If you want the query to display the information *exactly* as it's 
rendered in the original page, you may be able to use format=embed, 
which just embeds the pages matching the criteria.

>  Also, we would really like to display the 
> results of the parser extension ldapinfo 
> <http://www.sourcecodeonline.com/details/mediawiki_extension__ldap_info.html> 
> as a property….We are using MediaWiki 1.13.2 and Semantic Mediawiki 1.3.

Sorry, I'm not familiar with that extension.
Cheers,
--
=S Page

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Semediawiki-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel

Reply via email to