Help talk:Filtered format

From semantic-mediawiki.org

Filtered List with template not working with table-base introtemplate

I started experimenting with the Filtered Format as a potential solution to a question that my stakeholders asked. I was able to get a "list" result, and formatted with a template, but I ran into two issue;

  • they want the result presented in a tabular format - like the table view
  • but they want to customize how the contents in specific cells appear (merge two properties to provide a user friendly interface) - which the table format assumes all properties appear in separate cells

When I attempted to use a template format wherein the "template" just builds individual rows, and the introtemplate builds the table structure and header, I keep getting a "blue searching swirl" of death - just spinning with no results. Anytime I remove the "{|" table intro from the introtemplate, the query performs well - just not presented in a tabular structure (just rows with vertical pipes between properties).

The Filtered format suggests that this works "just like" format=template, but not quite? Are there limitations on what the template might include?

21:17, 10 March 2020

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? :) )

14:09, 13 November 2015

Columns in a list view? Is that somewhere documented?

18:07, 13 November 2015

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

20:57, 15 November 2015

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

21: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

16:28, 19 October 2015

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

16:38, 19 October 2015

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

11: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.

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
}}
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.

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|}}}
13:18, 29 July 2015

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

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.

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?

15:49, 10 July 2013

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

19: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.

20: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.

22: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.

01: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

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?

23:22, 25 August 2014

I'm afraid that's not possible.

07:35, 26 August 2014

OK. Thanks.

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?

21:18, 22 August 2014

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

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.

08:16, 9 September 2013

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

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?

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

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

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)...

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?

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

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?

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,

01: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.

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)

21:48, 6 September 2012

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

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)

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%;
20:59, 11 September 2012