Mel VIP
Total posts: 126
28 May 2014 05:44

I have records from all over the world and I would like to make a few shortcut links in the footer to a list of records from individual countries. For example the footer could have a link to only records from USA, another to a list of UK records and another to France, etc.

I thought I could do a search for records in a country and the url in the browser nav bar can be used for the link. But the url in the browser nav bar is the same for all countries. How can I make a link to only show results from one country?

Last Modified: 10 Jun 2014


klox7 VIP
Total posts: 914
28 May 2014 07:59

Hello,

how do you assign country to record? Category, field, map,...?

if you used countries as categories than you could have done this Click here to link...

If you use fields than read this article about creating prefiltered links Click here to link...


pepperstreet VIP
Total posts: 3,837
28 May 2014 20:56

Are you talking of records with a different "language" field?


Mel VIP
Total posts: 126
29 May 2014 01:14

klox7 If you use fields than read this article about creating prefiltered links Click here to link...

I tried doing what it said on that document page but I cannot make it work. No matter what I try I get errors.

From what I understand this should work but it does not:

http://xxxxxx.com/index.php?option=com_cobalt& ;task=records.filter&filter_name[0]=filter_k91fdaa5afb24bfc6b7dbdb47bfec4030&filter_val[0]=australia

This is the error I get:
500 View not found [name, type, prefix]: cobalt, html, cobaltView

I tried changing the 'key' to' field id' but it made no difference. I also tried adding the 'type' identifyer code before the field identifer code but got the same error.

pepperstreet Are you talking of records with a different "language" field?

No the site is only English language


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

Mel http://xxxxxx.com/index.php?option=com_cobalt& ;task=records.filter&filter_name[0]=filter_k91fdaa5afb24bfc6b7dbdb47bfec4030&filter_val[0]=australia

You also need your section id (cobalt) and itemid (menu id).

You should have something like

http://xxxxxx.com/index.php?option=com_cobalt& ;task=records.filter&section_id=ID&Itemid=ID&filter_name[0]=filter_k91fdaa5afb24bfc6b7dbdb47bfec4030&filter_val[0]=australia


Mel VIP
Total posts: 126
31 May 2014 04:00

klox7 You also need your section id (cobalt) and itemid (menu id).

Thanks for your help but I tried as you suggested and also different variations including the field ID number but I cannot get it to work.

The Section ID is: 1, the Type ID is: 1, the Field ID is: 4, the Menu item ID to the record list is: 123

How should the link look with this information?

There is a comment on the document page which says it did not work with 'key' but he used field ID and it worked. How should the link look with field ID?


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

Mel There is a comment on the document page which says it did not work with 'key' but he used field ID and it worked. How should the link look with field ID?

Instead of filter_name[0]=filter_k91fdaa5afb24bfc6b7dbdb47bfec4030 you use filter_name[0]=filter_12


Mel VIP
Total posts: 126
02 Jun 2014 22:37

Sergey Instead of filter_name[0]=filter_k91fdaa5afb24bfc6b7dbdb47bfec4030 you use filter_name[0]=filter_12

Hi Sergey I tried below code but it does not work.. It just goes to the list page with no filtering.
http://xxxxx.com/index.php?option=com_cobalt& ;task=records.filter&section_id=1&Itemid=123&filter_name[0]=filter_4&filter_val[0]=australia


Sergey
Total posts: 13,748
02 Jun 2014 22:48

DO you have multiple type section?


Mel VIP
Total posts: 126
03 Jun 2014 08:55

Sergey DO you have multiple type section?

There is only one section and one type.


Sergey
Total posts: 13,748
03 Jun 2014 11:42

Itemid i;s true or you jast put any?


Mel VIP
Total posts: 126
03 Jun 2014 23:27

I checked again - Item ID is true


klox7 VIP
Total posts: 914
04 Jun 2014 08:40

Mel Hi Sergey I tried below code but it does not work.. It just goes to the list page with no filtering.

Maybe a stupid question but do you have filters enabled in your field? This hapens on my page if I turn off "enable filter".


Mel VIP
Total posts: 126
04 Jun 2014 12:45

klox7 do you have filters enabled in your field?

Yes the filter is enabled. It's the geo field and people search by country in the list view (map) and also the filter module in the sidebar. They both work fine.


Sergey
Total posts: 13,748
05 Jun 2014 11:38

I see. It is a geo field. For this it should be filter_val[0][country]=australia


Mel VIP
Total posts: 126
06 Jun 2014 06:31

I tried as below but there is no results and this error "No records have been found according to your search criteria"

It looks like it should be working but there are over 200 records for Australia. I checked all the ID's etc and they are correct.

http://xxxxxx.com/index.php?option=com_cobalt& ;task=records.filter&section_id=1&Itemid=123&filter_name[0]=filter_4&filter_val[0][country]=australia


Sergey
Total posts: 13,748
08 Jun 2014 23:25

OK, I see. Probbaly because you have to use country index. Something like filter_val[0][country]=AU.


Mel VIP
Total posts: 126
10 Jun 2014 00:37

Hi Segey

Thanks very much for your help, it works perfectly now.

Powered by Cobalt