Skip Navigation

[Gelöst] filtering in view

This support ticket is created vor 2 Jahren, 2 Monaten. 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.

Heute stehen keine Supporter zur Arbeit im Werkzeugsatz-Forum zur Verfügung. Sie können gern Tickets erstellen, die wir bearbeiten werden, sobald wir online sind. Vielen Dank für Ihr Verständnis.

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

Supporter timezone: America/Jamaica (GMT-05:00)

Dieses Thema enthält 17 Antworten, hat 2 Stimmen.

Zuletzt aktualisiert von alexd-6 vor 2 Jahren, 1 Monat.

Assistiert von: Shane.

Author
Artikel
#2453065

Hey - Shane - sorry but my issue is to crazy for me - https://toolset.com/forums/topic/filter-did-not-work-on-submit-button/

can you have a look at this? - how can i connect these two filters?

in this page it works correctly - i only copied these two views corrected the settings and the shortcodes from versteckter Link in the new once which i used on versteckter Link:

from:
[wpv-form-view name="veranstaltungs-liste-filter01" target_id="self"]

[wpv-view name="veranstaltungs-liste-date-filter01" wpvrelatedto="[wpv-view name='veranstaltungs-liste-filter01' view_display='layout']"]

to:
[wpv-form-view name="veranstaltungs-liste-filter01-archiv" target_id="self"]

[wpv-view name="veranstaltungs-liste-date-archiv" wpvrelatedto="[wpv-view name='veranstaltungs-liste-filter01-archiv' view_display='layout']"]

in the view of archiv is a additional filter to show all from Today in past.

thx a lot and please have one look on it 8)

best regards - alex

#2453933

Shane
Supporter

Sprachen: Englisch (English )

Zeitzone: America/Jamaica (GMT-05:00)

Hi Alex,

Thank you for getting in touch.

Would you mind allowing me to have admin access to the site so that I can have a more detailed look at this one for you ?

I've enabled the private fields for your next response.

Thanks,
Shane

#2455623

Shane
Supporter

Sprachen: Englisch (English )

Zeitzone: America/Jamaica (GMT-05:00)

Hi Alex,

This should be filtering correctly now. The problem was that on this view below.
versteckter Link

You were using the wrong date filter on the post. You had the Date and time custom field when it should've been the letzter Termin custom field.

Please let me know if everything is working as intended now.
Thanks,
Shane

#2455639

Hi Shane - yes but in view if filter through this custom date field also, and it works..

look here: versteckter Link

thx for help - alex

#2455671

Shane
Supporter

Sprachen: Englisch (English )

Zeitzone: America/Jamaica (GMT-05:00)

Hi Alex,

This is because this view is displaying a completely different post type.

Its displaying the repeatable field group "Termine" while your other view is displaying the "Veranstaltungen" post type.

On the Veranstaltungen post type this date custom field doesn't exist on the post itself but rather in a repeatable field group. In such a case you won't be able to use the repeatable field date field to filter the post itself as essentially a different post type in a relationship with the Veranstaltungen post type.

Please let me know if this clarifies the issue for you.
Thanks,
Shane

#2456323

Hey shane,

no the

versteckter Link
versteckter Link
in

[wpv-form-view name="veranstaltungs-liste-filter01-archiv" target_id="self"]
[wpv-view name="veranstaltungs-liste-date-filter01-archiv" wpvrelatedto="[wpv-view name='veranstaltungs-liste-filter01-archiv' view_display='layout']"]

are the same like

versteckter Link
versteckter Link
in

[wpv-form-view name="veranstaltungs-liste-filter01" target_id="self"]
[wpv-view name="veranstaltungs-liste-date-filter01" wpvrelatedto="[wpv-view name='veranstaltungs-liste-filter01' view_display='layout']"]

->

i found a bug in Filter for custom fields - it work only "if string is greater than" - "if string is smaller than" it dont show some results!

And we can have this relationship from Function in tssupp-multi-rfg-parents -> versteckter Link i can give IDs for having multi-parents

thx for helping - best regards - alex

#2456435

Shane
Supporter

Sprachen: Englisch (English )

Zeitzone: America/Jamaica (GMT-05:00)

Hi Alex,

Both views are similar but not the same. This 1 doesn't have a date filter.
versteckter Link

While this one does
versteckter Link

So there are some differences.
it work only "if string is greater than" - "if string is smaller than"

The dates in the database are stored as a timestamp, so when writing the date filters you will need to compare it to a number. Dates before today() are less than the value of today so this should work since its a numeric comparison.

However is the view currently displaying the correct information ? I want to have a second look but I think there are some things that i'm unsure about. Mainly which filters are required.

Thanks,
Shane

#2457219

Hi Shane,

for first question - date filter hasen't a function - now i removed it from 27219 complete.

it work only "if string is greater than" - "if string is smaller than" -

Yes this is a string/timestamp - how can i filter "if string is greater than" but not "if string is smaller than" with same field?

thx for you helping - alex

#2458683

Shane
Supporter

Sprachen: Englisch (English )

Zeitzone: America/Jamaica (GMT-05:00)

Hi Alex,

The filter should work. I did a quick check and it does appear to be working even when I did a test on my end. It is important that the date filter is set to compare as a number. If it is set to compare as a string you may not get an accurate result.

Thanks,
Shane

#2458963

hi Shane,

thats great! - that work - but why is it greater than working with string? - > this is only a question rhetorical..

And: ist there a kind get Dates (Datum und Uhrzeit) of this in the Dropdown above Taxonomies? For Filtering?
versteckter Link

thx for your helping! - best regards - alex

ps: i saw that you work on Jamaica? - i am a big fan of jamaican music over the last 40 Years 😉

#2461013

Shane
Supporter

Sprachen: Englisch (English )

Zeitzone: America/Jamaica (GMT-05:00)

Hi Alex,

Happy i'm able to assist you thus far.
but why is it greater than working with string

The most I can say on this is that when you're using the string comparison the behavior can be unpredictable and inconsistent.

And: ist there a kind get Dates (Datum und Uhrzeit) of this in the Dropdown above Taxonomies? For Filtering?

Not sure i'm understanding full the issue here.

Also yes i'm from Jamaica 🙂

Thanks,
Shane

#2461017
Bildschirmfoto 2022-09-19 um 17.54.50.jpg

Hi Shane,

yes what i want to filter in the same view is about the dates.. - look at my screenshot:

All dates of the Events as dropdown filter too.

thx for your help

alex

#2461035

Shane
Supporter

Sprachen: Englisch (English )

Zeitzone: America/Jamaica (GMT-05:00)

Hi Alex,

Unfortunately no you won't be able to do this given that the view with the search doesn't have the date field on it. Unless you're going to be filtering your view by the letzter Termin date field.

Thanks,
Shane

#2461369

hi Shane,

another way: can i took the last date of "Datum und Uhrzeit" automatical set content to "letzter Termin" - Is this possible?

thx for you answer

Thanks - alex

#2461703

Shane
Supporter

Sprachen: Englisch (English )

Zeitzone: America/Jamaica (GMT-05:00)

Hi Alex,

Yes this can be possible, will you be setting it manually as to set it automatically will require some amount of custom coding. However if you do set the date to the last item then this can work since we will now be able to filter the posts.

Thanks,
Shane