Help talk:Filtered format

From semantic-mediawiki.org
(Redirected from Help talk:Filtered format)
These discussions were held with LiquidThreads. Each post's history is on its old Thread page, which now redirects here (list).

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)

I was able to find the fix for this.
  • File: srf-filtered.value-filter.css
  • Line 38:
- width: 20%;
+ width: 100%; Dgennaro (talk) 18:59, 11 September 2012 (UTC)

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)

Sorry for the late reply. I don't think, this is currently possible. Stephan Gambke (talk) 20:45, 16 October 2012 (UTC)

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) 23:59, 18 January 2013 (UTC)

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. Stephan Gambke (talk) 20:22, 13 May 2013 (UTC)

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) 16:52, 3 July 2013 (UTC)

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) 13:49, 10 July 2013 (UTC)
This is still an issue upgrading to PHP 5.4.20. Is anyone else experiencing this issue? Dgennaro (talk) 17:45, 4 December 2013 (UTC)
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. Stephan Gambke (talk) 18:56, 4 December 2013 (UTC)
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) 20:38, 4 December 2013 (UTC)
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) 23:06, 10 March 2015 (UTC)
You are not alone: https://github.com/SemanticMediaWiki/SemanticResultFormats/issues/80 Thing is, I have no idea what could be wrong. I can not reproduce it.
Is your wiki public by any chance, so that I could have a look? Stephan Gambke (talk) 07:17, 11 March 2015 (UTC)

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) 08:22, 12 August 2013 (UTC)

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) 06:52, 7 September 2013 (UTC)

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. Alexander Gesinn (talk) 06:16, 9 September 2013 (UTC)

... the same exception occurs when using DIVs with display:table styles. Alexander Gesinn (talk) 07:00, 9 September 2013 (UTC)
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) 18:16, 29 September 2013 (UTC)
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 Alexander Gesinn (talk) 17:01, 1 October 2013 (UTC)
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) 17:15, 1 October 2013 (UTC)
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) 23:52, 13 May 2014 (UTC)

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) 06:38, 13 September 2013 (UTC)

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) 20:49, 13 September 2013 (UTC)

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) 19:18, 22 August 2014 (UTC)

Forget it. Figured it out. Have to specify the printout label before setting the filter options. Jamal Rahal (talk) 19:44, 22 August 2014 (UTC)

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) 21:22, 25 August 2014 (UTC)

I'm afraid that's not possible. Stephan Gambke (talk) 05:35, 26 August 2014 (UTC)
OK. Thanks. Jamal Rahal (talk) 14:06, 26 August 2014 (UTC)

Replace Filter value

Hi,

How could I replace filter value result!?

Example: Filter option 1=FilterOption1, need Filter option 1=DifferentTextof FilterOption1 Stroybizz (talk) 21:55, 21 September 2014 (UTC)

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) 12:34, 27 July 2015 (UTC)

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

Stephan Gambke (talk) 17:43, 27 July 2015 (UTC)

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) 11:05, 29 July 2015 (UTC)

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

Stephan Gambke (talk) 11:18, 29 July 2015 (UTC)

Thank you, that perfectly works, and it seems, that I've almost got, why. Edmus (talk) 12:40, 29 July 2015 (UTC)

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) 14:28, 19 October 2015 (UTC)

No, this is not possible. (But it's a nice idea. Patches welcome. ;) ) Stephan Gambke (talk) 14:38, 19 October 2015 (UTC)
Ok. Thanks for the reply. Have to see if my client is willing to pay me for it :) MathiasLidal (talk) 09:30, 26 October 2015 (UTC)

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) 12:09, 13 November 2015 (UTC)

Columns in a list view? Is that somewhere documented? Stephan Gambke (talk) 16:07, 13 November 2015 (UTC)
It's in the OL result format, to be specific: https://semantic-mediawiki.org/wiki/Help:Ol_format MathiasLidal (talk) 18:57, 15 November 2015 (UTC)
I see. No, Filtered format does not have this. Stephan Gambke (talk) 19:46, 15 November 2015 (UTC)

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? Rwjorgen (talk) 19:17, 10 March 2020 (UTC)

Cookies help us deliver our services. By using our services, you agree to our use of cookies.