Skip Navigation

[Resolved] Display another filter at custom view page

This support ticket is created 5 years, 7 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 15 replies, has 2 voices.

Last updated by rainerS 5 years, 7 months ago.

Assisted by: Minesh.

Author
Posts
#1105505

Hi,

I´ve created a view "Partnersuche", which displays a custom search / filter at my front page. When I hit the submit button a second page is displayed, where I´ve inserted the view itself.
So search and view are placed at different pages like you´ve described it at your documentation for creating custom filters.

I´ve hidden the filter on the results / view page. Now I´ve got the following problem: is it possible anyway to display a second filter at the view / results page, which is only a custom taxonomy filter like a grid filter tab element?
What have I to do to make it possible using a second filter at the view / results page itself on top, which differs from the custom search page? It´s only about one custom post type and only about using another custom taxonomy, which is related to this post type.

Thanks and regards,

#1106393

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - basically, either you can show or hide the search filter. You can not split the filter form.

But - I think I have a way to show/hide the other filters based on views conditional statement but it totally depends on how you setup your filter and search result page.

If you can share your problem URL where you added your view and access details with information which filter you want to show/hide I can try to check if its possible in this case.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).

I have set the next reply to private which means only you and I have access to it.

#1106421

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Ok - I think it will work for you.

What I've done is I made the changes to display the filter with your search result page by setting hide="false":

[wpv-filter-start hide="false"]

Then - within your view's filter box - I've added conditional statement, that if there is URL param wpv-schwerpunkt is blank then and then display the filter on search result page.

So - you can use the conditional satement as per your requirement and show/hide your filters.

For example:

[wpv-conditional if="( '[wpv-search-term param='wpv-schwerpunkt']' eq '' )"]

<div class="form-group">
	<label>[wpml-string context="wpv-views"]Für welches Projekt suchen Sie einen Planer?[/wpml-string]</label>
	[wpv-control-post-taxonomy taxonomy="schwerpunkt" type="radios" default_label="" url_param="wpv-schwerpunkt"]
</div>
[/wpv-conditional]

If you see with your result page - the filter with taxonomy schwerpunkt will not display but it will display on search page initially.

More info:
=> https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-search-term

#1106423

Hi,

thanks. I don´t see the second part wpv conditional at my view - have you inserted it?

Now I´ve got the problem, that the whole search mask is displayed on top. At the search result page it only should displayed the parameter "wpv-planertyp".
Is there a conditional logic for only display at the search page?

Regards,

#1106428

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Well - I dont think second view needed here as we can manage with one view only.

I've edited the following view:
=> hidden link

All filters are displayed here:
=> hidden link

And once you chose your filter and click on search button, you will be redirected to search result page where we hide the taxonomy filter schwerpunkt.

#1106473

Hi,

I think you haven´t saved your prior work or I´ve saved at the same time - don´t know. Can you please re add the condition?

The right condition would be: the whole filter from page 1 is not displayed at page 2, but a new filter is displayed, which was not present at page 1. This filter is called wpv-partnerart. Can you please adjust your example and add it to view 14?

Regards,

#1106479

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Ok - your filter section looks like as given under for view ID 14.

[wpv-filter-start hide="false"]
<div class="intro">
  <div class="intro-text">
    <p>
      Ob Dachbodensanierung, Dachausbau oder Neubau - mit der Velux Planersuche finden Sie den passenden Planer für Ihr Projekt.
    </p>
    <p class="description">
      Geben Sie nachfolgend die Details zu Ihrem Projekt an und finden Sie einen Planungspartner in Ihrer Nähe.
    </p>
  </div>
  <div class="intro-image">
    <img src="/wp-content/uploads/2018/09/planer.jpg" alt="Planer" />
  </div>
</div> 
[wpv-filter-controls]
[wpv-conditional if="( '[wpv-search-term param='wpv_filter_submit']' eq '' )"]

<div class="form-group">
	<label>[wpml-string context="wpv-views"]Für welches Projekt suchen Sie einen Planer?[/wpml-string]</label>
	[wpv-control-post-taxonomy taxonomy="schwerpunkt" type="radios" default_label="" url_param="wpv-schwerpunkt"]
</div>

  <div class="form-group">
	<label>[wpml-string context="wpv-views"]Für welche Dachformen interessieren Sie sich?[/wpml-string]</label>
	[wpv-control-post-taxonomy taxonomy="dachform" type="radios" default_label="" url_param="wpv-dachform"]
</div>
<div class="form-group">
	<label>[wpml-string context="wpv-views"]Für welches Projekt suchen Sie einen Planer?[/wpml-string]</label>
	[wpv-control-post-taxonomy taxonomy="projektart" type="radios" default_label="" url_param="wpv-projektart"]
</div>
<div class="form-group">
	<label>[wpml-string context="wpv-views"]In welchem Bundesland liegt ihr Bauvorhaben?[/wpml-string]</label>
	[wpv-control-post-taxonomy taxonomy="bundesland" type="select" default_label="Bitte wählen" url_param="wpv-bundesland"]
</div>
[/wpv-conditional]
[wpv-conditional if="( '[wpv-search-term param='wpv_filter_submit']' ne '' )"]
<div class="form-group">
	<label>[wpml-string context="wpv-views"]Planertypen[/wpml-string]</label>
	[wpv-control-post-taxonomy taxonomy="planertyp" type="select" default_label="Please Select" url_param="wpv-planertyp"]
</div>
[/wpv-conditional]
<button class="search-submit">[wpv-filter-submit name="Planer suchen" output="bootstrap"]</button>
[/wpv-filter-controls]
[wpv-filter-end] 

Could you please check and confirm.

#1106482

Thank you very much - it works now.

Is it possible somehow to have ajax filtering instead of submit button on the second filter or is this not part of the condition?

Regards,

#1106483

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Well - in your case, you need to use the submit button, Ajax will not work with this case.

#1106547

Thanks, solved!

#1106594

Hi,

sorry, but it doesn´t work. I don´t know why, but the conditional logic isn´t working. It seemed to be worked a short time. I´ve checked all options and changed nothing big, so I don´t know, why the condition is not working.

Can you please check?

Thanks and regards,

#1106615

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Well - you need to use the submit button not the button.

So - I've added follwoing code:

[wpv-filter-submit name="Planer suchen" class="search-submit btn btn-large btn-primary" output="bootstrap"]

And removed the following from your search filter box:

[wpv-filter-submit type="button" output="bootstrap" class="search-submit btn btn-large btn-primary" name="Planer suchen" ]

And I can see its working.

#1106625

Hi,

thanks, why is type=button not working? Would be necessary to add an after symbol element by css.

Regards,

#1106626

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Well - submit is required as button type will not pass the URL param wpv_filter_submit in URL when you click on submit button - and we show/hide your filters based on that URL param.

So, submit is required, you should not use button type.

#1106681

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Could you confirm its working again?

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.