Skip Navigation

[Resolved] Calculate age view does not work on overview page

This thread is resolved. Here is a description of the problem and solution.

Problem: I have a View that is used to calculate ages. On first load everything works as expected, but reloading the page produces unexpected results. Sometimes the values are incorrect or missing. It seems random.

Solution: You have a Post ID filter, set to respond to a shortcode attribute. However, there was no shortcode attribute applied in the go zoeker filter + map 2 View. So I added that param:

<div class="grid-55">[wpv-view name="tv-pp-leeftijd-go" idgoleeftijd="[wpv-post-id]"]

Relevant Documentation:
https://toolset.com/documentation/user-guides/passing-arguments-to-views/

This support ticket is created 5 years, 10 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 4 replies, has 2 voices.

Last updated by Bob 5 years, 10 months ago.

Assisted by: Christian Cox.

Author
Posts
#1216955

Bob
Age-B.png
Age-A.png

I have embedded a view, calculating age from a date field (https://toolset.com/forums/topic/calculte-age/) in a view that renders multiple outcomes depending on distance.
The age field however does not reflect the correct age. Instead, it displays the same age for all results (A). As long as I use this field in another view which is used on a page showing only the results for one person (B) it works fine.

EDIT: it seems the function displays erratic behavior. A browser refresh can alter the outcome, also on the pages with one age.

How can I make this work?

A. Page with multiple results: hidden link
B. Underlying page with one age field: hidden link

#1218085

Hi, I'm trying to investigate this now but I see an error establishing a database connection. Can you check?

#1218553

Bob

Hey Christian,

Sorry about that... Up and running again 🙂

#1219072

Okay I can see in the PP - Leeftijd GO View you have a Post ID filter, set to respond to a shortcode attribute. However, there was no shortcode attribute applied in the go zoeker filter + map 2 View. So I added that:

 
<div class="grid-55">[wpv-view name="tv-pp-leeftijd-go" idgoleeftijd="[wpv-post-id]"]

I'm not able to reproduce the problem where the age changes during a page reload. Is that problem still occurring?

#1219611

Bob

Totally missed that one 😐 All is working fine now, thanks!