Skip Navigation

[Resolved] Generating a list of child post IDs to use in another view

This support ticket is created 3 years, 11 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.

Our next available supporter will start replying to tickets in about 0.99 hours from now. Thank you for your understanding.

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 10 replies, has 2 voices.

Last updated by stuart 3 years, 11 months ago.

Assisted by: Minesh.

Author
Posts
#1881437
fig4-post-id.jpg
fig3-failed-output.jpg
fig2-working-output.jpg
fig1-query filter.jpg

I am trying to use a Toolset View to filter by IDs generated by another view, comma-separated.

I have a 2 looped views

UK Areas (Parent) > UK Locations (Child)
This outputs a nice clean set of IDs of the posts I would like to use (UK locations) - based on where the view is inserted.
e.g:
28243,28242,28293,28147,28241,28146,28076,28240,28292,28075,28145,28239,28238,28263,28291,28237,28074,28073,28072,28236,28290,28071,28070,28235,28144,28234,28233,28232,28231,28143,28230,28069,28142,28262,28261,28260,28289,28056,28229,28210
(both views have this ticked: Disable the wrapping DIV around the View )

In the new view, I would like to use the view above to set the ids of the post to be displayed using the query filter seen in fig1-query filter

This works, obviously 🙂
e.g:
[wpv-view name='uk-granchild-view-l2-areas-counties-2' ids="28243,28242,28293,28147,28241,28146,28076,28240,28292,28075,28145,28239,28238,28263,28291,28237,28074,28073,28072,28236,28290,28071,28070,28235,28144,28234,28233,28232,28231,28143,28230,28069,28142,28262,28261,28260,28289,28056,28229,28210"]

And outputs like this: fig2-working-output

This doesnt work:

[wpv-view name='uk-granchild-view-l2-areas-counties-2' ids="[wpv-view name='uk-granchild-view-l1-regions-ids']"]

And it looks like this, fig3-failed-output
youll notice the > "] closing bracket that is present.

I also tested with just wpv-post item, to see if it was the view with the issue... and it doest something a little differnet - see image, fig4-post-id
There is still the closing bracket that appears and it outputs the view with all ids, and doesnt apply the filter.

View i inserted below:
[wpv-view name='uk-granchild-view-l2-areas-counties-2' ids="[wpv-post-id item='28385']"]

Any help would be awesome.

Thanks

#1882249

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

It looks like shortcode within the shortcode is not get parsed.

Can you please share problem URL where you added the view's shortcode as well as access details.

*** 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 have set the next reply to private which means only you and I have access to it.

#1883387

Minesh
Supporter

Languages: English (English )

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

Thank you for sharing admin access details and the admin access details is working.

But when I try to access any page on the frontend it again asks me for password and when I try to add the password you shared it does not work. Can you please make sure that I should be able to access the frontend as well and please share the password to access the same.

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

#1883411

Minesh
Supporter

Languages: English (English )

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

Yes - I tried the password you shared but its not working. Can you please disable frontend password so that I can access the frontend without any blocking.

#1883431

Ive disabled, please try again...

#1883637

Minesh
Supporter

Languages: English (English )

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

Can you please check now: hidden link

I've created a content template:
=> hidden link

And added the view's shortcode as given under:

[wpv-view name='uk-granchild-view-l2-areas-counties-2' ids="[wpv-view name='uk-granchild-view-l1-regions-ids']"]

Can you please confirm it works as expected?

#1883657

hey Minesh - thats seems to have resolved the issue... what was the issue?

#1883659

Minesh
Supporter

Languages: English (English )

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

It seems that shortcode module belongs to block does not able to render the nested shortcodes (in this case views shortcodes) as expected so I created the blank content template and added the nested shortcode you were using to it and it just works as expected.

#1883671

interesting, I believe I tried the same thing with a Toolset "Fields and Views" block with the same effect.

And I have a feeling I tried a content template, as i thought it was a rendering of shortcodes issue (but may not have tested it well enough)

But that suits me as a result.

Could you remove the lines from the previous chat to the site? it's underdevelopment

https://toolset.com/forums/topic/generating-a-list-of-child-post-ids-to-use-in-another-view/#post-1883637

Cheers 🙂

Appreciate your help as ever.

#1883707

Minesh
Supporter

Languages: English (English )

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

Glad to help.

I've removed the domain name from that mentioned reply. Please feel free to mark resolve this ticket 🙂 Have a great time!!

#1883723

Thanks again Minesh