brianpat VIP
Total posts: 211
03 Feb 2015 19:56

Does anyone know How can I keep the advanced search form always opened by default? Also how can I order fields within it?

Last Modified: 05 Feb 2015


pepperstreet VIP
Total posts: 3,837
04 Feb 2015 00:07

brianpat How can I keep the advanced search form always opened by default?

Related topic with answers can be found over here:

brianpat how can I order fields within it?

I guess the default filters order depends on the field's backend order. The default output works similar to the regular fields loop. Here is the rough filter output order:

Content types, Categories, Tags, Authors (if enabled)
Then all filterable Fields (by backend order)

So, for a total custom placement you might create a custom markup-layout template. Please have a look into the related article in documentation area. Hence the notes about "markup template" at the bottom...


brianpat VIP
Total posts: 211
04 Feb 2015 09:43

Thanks. It works fine now. Now I have two questions:

1) within advanced search, there are tabs. Can I make one of the tabs which is not the first make it opened by default. If yes, how can I do this? 2) How can I disable the search text which appears adjacent to advanced search ?


pepperstreet VIP
Total posts: 3,837
04 Feb 2015 22:43

brianpat 1) ... Can I make one of the tabs which is not the first make it opened by default.

See markup template around line# 590. There is a javascript that triggers the FIRST tab:

jQuery('#vtabs a:first').tab('show');

If you definitely know your total tab count, you may trigger a specific tab by replacing the pseudo-class first ... with eq(X). Where X is your tab number -1:

First tab is first OR eq(0) !
Second tab is eq(1)
Third tab is eq(2)
etc.

Example - show fifth tab

jQuery('#vtabs a:eq(4)').tab('show');

pepperstreet VIP
Total posts: 3,837
04 Feb 2015 22:48

brianpat 2) How can I disable the search text which appears adjacent to advanced search ?

Sorry, which text do you refer to?


brianpat VIP
Total posts: 211
04 Feb 2015 23:38

pepperstreet

brianpat 1) ... Can I make one of the tabs which is not the first make it opened by default.

See markup template around line# 590. There is a javascript that triggers the FIRST tab:

jQuery('#vtabs a:first').tab('<span class="operator"><span class="keyword">show</span><span class="string">');
</span></span>`</pre>

If you definitely know your total tab count, you may trigger a specific tab by replacing the pseudo-class _first_ ... with _eq(X)_. Where **X** is your tab number **-1**:

First tab is _first_ OR _eq(0)_ !

Second tab is _eq(1)_

Third tab is _eq(2)_

etc.

#### Example - show fifth tab

<pre>`jQuery('#vtabs a:eq(4)').tab('<span class="operator"><span class="keyword">show</span><span class="string">');
</span></span>

Thanks, so can i apply this logic in cobalt module filter. For example if i want to make 4th tab to be shown first, can I do this way?


pepperstreet VIP
Total posts: 3,837
05 Feb 2015 00:49

brianpat can i apply this logic in cobalt module filter. For example if i want to make 4th tab to be shown first, can I do this way?

You are talking of alternative module layout "collapse" ?
Yes, should work similar...

Example - open 4th filter collapse:

jQuery('#filter-form .collapse:eq(3)').collapse('show')

Or use specific #identifier (see ID in browser page source):

Example for specific field/filter:

jQuery('#filter-kc76dedca108ae9aa95be1f119b476f3').collapse('show')

Or tags filter:

jQuery('#filter-tags').collapse('show')

PS: The above examples only SHOW the contents. It does not change the "active" display style. Should be easy with some extra javascript. Sorry, I am not a JS guru ;)


brianpat VIP
Total posts: 211
05 Feb 2015 09:08

Hi, Thanks for your reply. No I am talking about the default one in module filter. Currently the fields are shown as per my backend. I woul like to show 5 the field which is a google map in the first place, is it possible?


pepperstreet VIP
Total posts: 3,837
05 Feb 2015 13:30

brianpat I woul like to show 5 the field which is a google map in the first place, is it possible?

Please, see my first comment and link to documentation article about custom filter module. All answers are there ;)

Powered by Cobalt