klox7 VIP
Total posts: 914
14 May 2014 14:29

Hey,

based on this docs Click here to link... I created prefiltered links. Everything works fine except on boolean field. I have boolean field with Yes ano No values. I created this link

<a href="/support/community-forum.html?amp;task=records.filter&amp;section_id=1&amp;item_id=134&amp;filter_name[0]=filter_k326e56efad5b4854d31ad5f6c5404389&amp;filter_val[0]=Yes">Yes</a>

and it doesn't work.

Second, is it possible for prefiltered links first to reset all filters and then apply new one?

Thanks

Last Modified: 18 Jun 2014



Sergey
Total posts: 13,748
15 May 2014 06:02

The Yes/No is the text of the field. It may be True/False, Mail/Femail, etc... But ture values are always 1/-1.

Also what is item_id=134? If it is Joomla parameter it should be Itemid=134.


klox7 VIP
Total posts: 914
15 May 2014 08:02

I changed item_id to Itemid in docs.

filter_val[0]=true works now.

What about possibility to reset and apply filters at same time with prefiltered links?


Sergey
Total posts: 13,748
15 May 2014 11:26

You should use filter_val[0]=1 or filter_val[0]=-1

klox7 What about possibility to reset and apply filters at same time with prefiltered links?

You want to reset all filters before apply others?

In the new version I'll release today, you can use clean=1 in the URL. I updated the document. See reset and Set filters block.


klox7 VIP
Total posts: 914
15 May 2014 11:52

Sergey You should use filter_val[0]=1 or filter_val[0]=-1

I coundn't done it like this! It just says 1 or -1 in filter alert.> Sergey

You want to reset all filters before apply others?

Yes. I love prefiltered links because I can add different options for people. But if some other filter is applied from before then it has no meaning.


Sergey
Total posts: 13,748
15 May 2014 12:05

Right, it is true and false for filters.


klox7 VIP
Total posts: 914
15 May 2014 15:01

Do prefiltered links have the option to populate values in markup filter and filter module when applied?


klox7 VIP
Total posts: 914
15 May 2014 15:06

Just found out that you have to put exactly the same value as it is in field options. If it is 'Car' filter value has to be filter_val[0]=Car in if it's 'car' then filter value has to be filter_val[0]=car and so on.


pepperstreet VIP
Total posts: 3,837
15 May 2014 19:57

Related question:

  • Why can't we use a similar approach and syntax for "Sorting order" ?
  • Where and how is sorting applied (technically) ?

Sergey
Total posts: 13,748
16 May 2014 04:45

Theoreticaly it is possible. But it is too complicated.


pepperstreet VIP
Total posts: 3,837
16 May 2014 08:17

Sergey Theoreticaly it is possible. But it is too complicated.

? From my point of view... it feels very similar. And logically I expect it to work similar.

What is the difference between "apply filters" and "sorting"? I mean, what happens when I change the order?

(PS: As long as there is no backend record order number, I would need a default ordering on a custom field. Otherwise Cobalt is not an option for one of my next projects. What a pity.)


Sergey
Total posts: 13,748
16 May 2014 11:16

You can add to section root URL filter_order and filter_order_Dir parameters. filter_order_Dir may be asc or desc. And for field filter_order mast be field^k7b707926e5695cbaf6a90706436a2614^digits. It is a 3 values separated by ^. First keywork field always the same. Then field key. And then indicate what is the value of this field digits or string.


pepperstreet VIP
Total posts: 3,837
16 May 2014 14:37

Sergey You can add to section root URL filter_order and filter_order_Dir parameters. filter_order_Dir may be asc or desc. And for field filter_order mast be field^k7b707926e5695cbaf6a90706436a2614^digits. It is a 3 values separated by ^. First keywork field always the same. Then field key. And then indicate what is the value of this field digits or string.

Cool! Why isn't it mentioned in the docs?

And most important, why isn't it implemented in section/template parameters? (you may know my other related topics ;-) )


pepperstreet VIP
Total posts: 3,837
17 Jun 2014 01:48

Sergey You can add to section root URL filter_order and filter_order_Dir parameters. filter_order_Dir may be asc or desc. And for field filter_order mast be field^k7b707926e5695cbaf6a90706436a2614^digits. It is a 3 values separated by ^. First keywork field always the same. Then field key. And then indicate what is the value of this field digits or string.

Please, can you write a complete example URL... before I am going to waste hours with a simple syntax error. Just want to be sure I got the whole idea. Thanks in advance.


Sergey
Total posts: 13,748
18 Jun 2014 01:23

Just take any URL and add

 http://mysite.com/link/to/cobalt/section/?filter_order=field ^k7b707926e5695cbaf6a90706436a2614^digits&filter_order_Dir=DESC 

pepperstreet VIP
Total posts: 3,837
18 Jun 2014 01:48

@Sergey
Aah! Thank you. Maybe too easy and I was too tired! ;) (night shift)

BTW, wouldn't it make sense to add something like this as menuItem parameters? I mean, advanced tab where you can build this type of URL? Simply by multiple (cascading) selectboxes? Something like an "input wizard".


Sergey
Total posts: 13,748
18 Jun 2014 08:16

I think I'll finaly add parameter to select field to order by by default.

Powered by Cobalt