Help talk:Filtered format

From semantic-mediawiki.org
Jump to: navigation, search

MW 1.17.2 Requirement

Is MW "1.17.2 or later" a hard requirement, or just the lowest version it was tested with? I've been playing with the latest 1.7.0 stable version of SMW+, and it wants to use 1.17.0. Thanks. --Salq 17:22, 22 May 2012 (CEST)

1.17 should be fine. Where does the 1.17.2 come from? --F.trott 18:03, 22 May 2012 (CEST)


"Show embed" Question

I implemented similar functionality to that shown on the Days Out sample page using server-sided RunQuery. My solution works well, and it let me provide the resulting query as text so my users can cut-and-paste it into their own articles. Is there any chance for a "Show embed code" type of option for this client-side solution? I like this interface so much that I may have to create a separate build-a-query interface to take care of my users, though that's awkward. Thanks. --Salq 17:22, 22 May 2012 (CEST)

You could probably implement a view that displays the condition (i.e. the actual query), but anything else (printouts, format, other parameters) would be difficult. Nothing like this is currently planned. --F.trott 18:03, 22 May 2012 (CEST)


Result Limits?

Has Filtered Format been tested with very large query results (>> 500)? Inline queries give you the "Show further results" link, does Filtered format work with this? For instance, if you say next 20, do the 20 records come down, get filtered, and potentially show less than 20 records, or does the client side keep asking for records until it gets 20 that match the filter? Thanks. --Salq 17:22, 22 May 2012 (CEST)

No, the format has not been tested with very large datasets. There is also no "Show further results" link. The problem is, that with an incomplete dataset features like sorting would not be possible. Also for many views it would not make sense to limit the displayed results like that (e.g. maps). However, it should be possible to implement a paging functionality client-side for the views where it does make sense (e.g. lists). --F.trott 18:03, 22 May 2012 (CEST)

Examples of usages?

Are there any live examples of this extension used in the wild? Would be great to see some links to examples, if someone knows of one! Rotsee 16:01, 5 June 2012 (CEST)

See here: http://aroundisleofwight.info/en/Days_Out --F.trott 16:18, 5 June 2012 (CEST)
Thank you! Rotsee 21:06, 10 June 2012 (CEST)

Contents

Thread titleRepliesLast modified
List with multiple columns320:46, 15 November 2015
Filter results using dropdown lists210:30, 26 October 2015
Values of properties is displayed in Views414:40, 29 July 2015
Filter result format borken after PHP upgrade 608:17, 11 March 2015
Replace Filter value023:55, 21 September 2014
Can I set a default filtered value216:06, 26 August 2014
Can I change the label for the list of filters?121:44, 22 August 2014
Exception with template and table (mw.loader::execute)501:52, 14 May 2014
Changing the Order of Filtered Value Options122:49, 13 September 2013
Transtion Effects for Filtered format Results008:52, 7 September 2013
Filtering show for certain value page with empty values sometimes not010:22, 12 August 2013
Does it integrate with other results formats?122:22, 13 May 2013
Filter on category122:45, 16 October 2012
Facet value formatting120:59, 11 September 2012

List with multiple columns

The normal list result view allows you to specify the number of columns. Is this possible with the filtered list view as well? (If so, how? :) )

MathiasLidal (talk)13:09, 13 November 2015

Columns in a list view? Is that somewhere documented?

F.trott (talk)17:07, 13 November 2015

It's in the OL result format, to be specific: https://semantic-mediawiki.org/wiki/Help:Ol_format

MathiasLidal (talk)19:57, 15 November 2015

I see. No, Filtered format does not have this.

F.trott (talk)20:46, 15 November 2015
 
 
 

Filter results using dropdown lists

Is there any way to configure this extension to present the filters as dropdown-lists instead of checkboxes? This looks like just what I need for a project but the number of filter elements will be unmanagable with checkboxes

MathiasLidal (talk)16:28, 19 October 2015

No, this is not possible. (But it's a nice idea. Patches welcome. ;) )

F.trott (talk)16:38, 19 October 2015

Ok. Thanks for the reply. Have to see if my client is willing to pay me for it :)

MathiasLidal (talk)10:30, 26 October 2015
 
 

Values of properties is displayed in Views

When I call a list of pages to be displayed in the Views area using a specific Property, the extension displays not only urls to these pages, but also all values of the property in brackets after each item in the list. Is there a way to hide these values?

Please take a look at the code

{{#ask:
[[set::Person]]
|?Interest#
|+filter=value 
|+value filter height=200px
|format=filtered
|views=list
|list view type = list
|headers=hide
}}

The result can be found on the page http://mathphys.wiki/Research . I am using SMW on the http://wiki.wiki hosting.

Basically, the problematic output looks like

Akhmedov Emil Tofik ogly (Integrability, Black holes),

where "Integrability" and "Black holes" are the undesired values.

Edmus (talk)14:34, 27 July 2015

Not sure I understand the question correctly. If you ask for ?Interest to be displayed, it will be displayed. So, to not have it displayed, just do not ask for it:

{{#ask:
[[set::Person]]
|+filter=value 
|+value filter height=200px
|format=filtered
|views=list
|list view type = list
|headers=hide
}}
F.trott (talk)19:43, 27 July 2015

I am sorry, may be I do not understand syntax of the extension correctly. If I remove asking for the property Interest, then it will not know, what property values to filter. I mean, that there will be nothing to display in the "filters" block.

In particular, the code you suggest, just lists all the pages with value "Person" of the property "set" without any possibility to filter the results. Please look at the page http://mathphys.wiki/Research , where in the new section I just removed asking for the property Interest.

Hence, I want values of the property "Interest" to be displayed in the block "Filters" but not in parentheses in the block "Views". For example, the format "broadtable" works in a similar way, it provides an addition block for property values, if necessary, without putting them into parentheses after page urls.

Hope, I've put things in a more clear way.

Edmus (talk)13:05, 29 July 2015

Ah, good point. I guess you will need a template then. Something like this:

{{#ask:
[[set::Person]]
|?Interest#
|+filter=value 
|+value filter height=200px
|format=filtered
|views=list
|list view type = list
 
|list view template = PageOnly
 
|headers=hide
}}

... with a page Template:PageOnly containing just

{{{1|}}}
F.trott (talk)13:18, 29 July 2015

Thank you, that perfectly works, and it seems, that I've almost got, why.

Edmus (talk)14:40, 29 July 2015
 
 
 
 

Filter result format borken after PHP upgrade

After upgrading from PHP 5.4.13 to 5.4.16 the filtered format will now only show one result. I have not noticed this issue with any other result format. Please help.

Dgennaro (talk)18:52, 3 July 2013

Still broken when upgrading to PHP 5.4.17. Filtered result format only shows the last result. Is anyone else experiencing this problem?

Dgennaro (talk)15:49, 10 July 2013

This is still an issue upgrading to PHP 5.4.20. Is anyone else experiencing this issue?

Dgennaro (talk)18:45, 4 December 2013

Hi Desiree,

no promises on if and when this will get fixed, I'm rather busy at the moment. But at least I raised a bug on this now so I won't forget it (again). See here: https://bugzilla.wikimedia.org/show_bug.cgi?id=57993 . If you want, put yourself on the CC list.

F.trott (talk)19:56, 4 December 2013

Phew...I was starting to panic thinking that there was something wrong with my installation. I have been torturing myself over this for months. Thank you for getting back to me. I will wait patiently.

Dgennaro (talk)21:38, 4 December 2013

Hi, This is affecting me also - I'm on PHP 5.5.9. I'm glad someone else found this or I would have spent hours scratching my head and wondering what was wrong with my page.

Digitalash (talk)00:06, 11 March 2015
 
 
 
 
 

Replace Filter value

Hi,

How could I replace filter value result!?

Example: Filter option 1=FilterOption1, need Filter option 1=DifferentTextof FilterOption1

Stroybizz (talk)23:55, 21 September 2014

Can I set a default filtered value

Hi,

I have a query that returns a list of projects. I'm using this format to filter them by status (In Progress, On Hold, Completed,etc.).

{{#ask: [[Category:Projects]]
| ?HasStatus=Status:|+filter=value
|format=filtered
|views=list
}}

Is it possible to apply one filter value by default so that the query returns results with the "In Progress" box checked and the other options unchecked?

Jamal Rahal (talk)23:22, 25 August 2014

I'm afraid that's not possible.

F.trott (talk)07:35, 26 August 2014

OK. Thanks.

Jamal Rahal (talk)16:06, 26 August 2014
 
 

Can I change the label for the list of filters?

The list of filters is labeled with the name of the property used to filter results. Is there an easy way to change this?

Jamal Rahal (talk)21:18, 22 August 2014

Forget it. Figured it out. Have to specify the printout label before setting the filter options.

Jamal Rahal (talk)21:44, 22 August 2014
 

Exception with template and table (mw.loader::execute)

Hi,

Firebug reports 'mw.loader::execute> Exception thrown by ext.srf.filtered.value-filter: this.data(...).values[item] is undefined' when using filtered format with a template.

{{ #ask: [[Category:Process]]
    | ?Has Accountable|+filter=value
    | format = filtered
    | views=list
    | list view type=list
    | list view template=srfProcessFiltered
    | list view introtemplate=srfProcessFiltered_Intro
    | list view outrotemplate=srfProcessFiltered_Outro
}}

Intro Template:
<table>

Template:
<tr><td>{{{1}}}</td><td>{{{2}}}</td></tr>

Outro Template:
</table>

MW 1.19.7 SMW 1.8.0.5 SRF 1.8 $wgRawHtml=true;

The exception occurs during page load. The unfiltered content is loaded but when clicking on an filter item nothing happens (filter not applied).

This seems to happen only if table elements are present in the templates. Simple lists or comma separated output via template works fine.

Planetenxin (talk)08:16, 9 September 2013

... the same exception occurs when using DIVs with display:table styles.

Planetenxin (talk)09:00, 9 September 2013

The same happens with MW 1.20.7 and SMW 1.8.0.5. and $wgRawHtml=false; Did you file a bug for this?

[[kgh]] (talk)20:16, 29 September 2013

Hi Karsten, we were able to fix this. We (gesinn.it) sponsored dev for a new view "table". We are about to commit our changes very soon.

/Alexander Gesinn

Planetenxin (talk)19:01, 1 October 2013

Heiya Alexander,

that's very cool news! Adding more views to this result format is great and I am curious to try the implementation.

Cheers

[[kgh]] (talk)19:15, 1 October 2013

Is there a fix for this already? I have same issue with

  • MW1.22.6
  • SMW 1.9.2
  • SRF 1.9.1

Exception thrown by ext.srf.filtered.value-filter TypeError: this.data(...).values[item] is undefined ...m.nodeName.toLowerCase()===name.toLowerCase();},each:function(obj,callback,args)...

Kristiansta (talk)01:52, 14 May 2014
 
 
 
 
 

Changing the Order of Filtered Value Options

I am using this filtered results for properties with pre-defined values. For example:

|?Has Age = Age|+filter=value|+value filter height=200px|+value filter collapsible=uncollapsed

The values for 'Has Age' property is like: 0 to 6 months, 6 to 12 months, 1 year, 4 year, etc...

But the problem is, since the filter options are auto-listing it in alphabetical / numerical order, it is placing 6-12 months last on the list which I dont want. So it ends up looking like this:

0 to 6 months, 1 year, 4 year, 6 to 12 months,

How do I change it so the filter value options are actually listed like the default way it is in its properties and not sort them in numerical order which doesnt apply for this as it stuffs up the order of the list?

Alien Time (talk)08:38, 13 September 2013

Here is the solution given by Neill and it works perfect:

you can specify the order of the values. Simply add:

|+value filter values=0 to 6 months,6 to 12 months,1 year,4 years

Alien Time (talk)22:49, 13 September 2013
 

Transtion Effects for Filtered format Results

I have just installed this extension and I am very impressed with the amount of feature this ext provides. I looked at your sample here: http://aroundisleofwight.info/en/Days_Out . In that sample page, when the results are filtered, the list has a nice transition effect to it. How can add such an effect when the results are filtered?

Alien Time (talk)08:52, 7 September 2013

Filtering show for certain value page with empty values sometimes not

In domotiki I would to use the filtered format for filtering enterprises by protocol. When I select one value (a protocol) like 1-wire results shows only enterprise which propose this protocol and that's the good behaviour

But unfortunately when I select the protocol Rts, the result shows enterprise that don't propose anything(for which the properties "Protocol is empty) and of course entreprises that propose Rts.

You can see here what I mean.

Any Ideas ?

Thanks in advance

Nicolas NALLET (Sémantiki)10:22, 12 August 2013

Does it integrate with other results formats?

Seems filtered should act as a layer between other formats, such as map view. Has this idea been designed in, or would a map require a new version of the existing map format?

Cheers,

Dan Bolser (talk)00:59, 19 January 2013

Well, the idea has certainly crossed my mind. The current result formats miss the necessary JS interface, of course. And I guess, this interface would have to be better defined. I am not really happy with the code layout of the filtered format right now.

F.trott (talk)22:22, 13 May 2013
 

Filter on category

When filtered format is applied to a category, it will show all the available categories within your {{#ask ...}} query. However the namespace "Category:" will also be displayed. Is there a way to hide this?

E.g.: {{#ask: | ?Category=Model domain|+filter=value|+value filter switches=and or|+value filter height=110px|+value filter collapsible=uncollapsed

See also: http://csdms.colorado.edu/wiki/Test4 Thank you, --Albert (talk) 21:48, 6 September 2012 (CEST)

Albert (talk)21:48, 6 September 2012

Sorry for the late reply. I don't think, this is currently possible.

F.trott (talk)22:45, 16 October 2012
 

Facet value formatting

I am having a minior issue when using the filtered format. When there is a space in one of the facet values it adds a line break. So the facet value "Washington Redskins" is seen as:

Washington
Redskins

Thanks in advance. --Dgennaro (talk) 23:01, 5 September 2012 (CEST)

Dgennaro (talk)23:01, 5 September 2012

I was able to find the fix for this.

  • File: srf-filtered.value-filter.css
  • Line 38:
- width: 20%;
+ width: 100%;
Dgennaro (talk)20:59, 11 September 2012