Skip Navigation

[Closed] Display List of Child Post from Link in Modal

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.

This topic contains 5 replies, has 3 voices.

Last updated by Shane 5 years, 3 months ago.

Assigned support staff: Shane.

Author
Posts
#390369

I applied the below solution and need some tweaking. Inside my Parent posts list view table I duplicated this solution.

I visited this URL: https://toolset.com/forums/topic/display-the-all-child-message-count-of-parent/

Parent View:

<a href="[wpv-post-url]">[wpv-view name="My Count View" wpvprchildof="[wpv-post-id]"]</a>

Child View:
As instructed, I used

[wpv-found-count] Messages

in a separate child view to render the count from the relationship. It renders well in the parent post table view as expected!

I expected to see: It all works, but I really need the link to pop a modal listing the child posts and not go to the Parent's content template url view. I already have a post title url in a table column, so this would be a redundant link.

How do I tweak the code to not only give a count, but to render a child post list loop "onclick" in a modal? I can style the child list as a table in the modal on my own. Thanks!

#390498

To list Child Post Types (any information of those Posts) you create a View that lists the Post Type that is Child of (...) and then you call it where ver you want.

In your case you probably want to Query Child Posts of the Post set in the ShortCode argument (just as you do now for the count)

This View can be put into a Modal, and if you are on a specific Parent Post, and pass the ID of that parent Post to your View listing Child Posts, it should display all related Child posts.

It's elaborated here:
https://toolset.com/documentation/user-guides/displaying-related-child-posts/
https://toolset.com/documentation/user-guides/passing-arguments-to-views/

Please let me know if you need further infos about this.

Thank you for your patience.

#393527

Ok. Thanks. I'll give a try and post an update.

#394377

Shane
Supporter

Languages: English (English )

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

Hi Jan,

Unfortunately Beda is not available today so i'll be filling in temporarily.

Please let us know as soon as you have an update for us.

Thanks,
Shane

#403207

Okay. How do I get that created child list view to pop a modal from a parent post title w/link onclick? Do I put a modal javascript in View or Content Template?

#403392

Shane
Supporter

Languages: English (English )

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

Hi Jan,

You will need to add the modal js to which view/content template is displaying the parent post.

Next you will need to then add a link to the parent view to activate the modal. Could you let me know which modal code or plugin you are using ?

I know that modals normally have a structure that u must follow in order for it to work correctly.

Looking forward to hearing from you soon.

Thanks,
Shane

The topic ‘[Closed] Display List of Child Post from Link in Modal’ is closed to new replies.