Skip Navigation

[Resolved] Pulling content from 2 views into a 3rd view

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

This topic contains 1 reply, has 1 voice.

Last updated by joshM-4 6 years, 9 months ago.

Author
Posts
#554058
screenshot-2.png
screenshot-1.png

Tell us what you are trying to do? I have 2 views I'm trying to pull into a third view. The content of each view is controlled by the Post Type ID placed in the shortcode for that view. In the 3rd view, I have the 2 views embedded and am dynamically placing the ID into each view shortcode based on custom fields from that post type. (see screenshot 1 attached).

I am placing this third view into a php template like so:

<?php echo do_shortcode( '[wpv-view name="event-webinar-details-purchase" cached="off"]' ) ?>

This third view is being filtered by the Post ID of the page it's on (see screenshot 2 attached).

It's working a little. It is pulling the correct fields from the first 2 views (in the sense that I want the description field via the first view and the add-to-cart button from the second view), but those fields aren't using the IDs from the custom fields set to designate those ideas on the page the view is displayed.

So, for example, on this Event post - (hidden link) I'm using this view [wpv-view name="event-webinar-details-purchase" cached="off"] to pull in this view [wpv-view name="course-details" ids="[types field='webinar-course-id' output='raw'][/types]"] that displays the Course Description from this Course post (hidden link), and to pull in this view [wpv-view name="webinar-purchase" ids="[types field='webinar-product-id' output='raw'][/types]"] to display the associated price and an Add To Cart button from this Product (hidden link).

As you can see, it's pulling in information, but the information isn't from that Course and that Product (e.g. it's not using the correct IDs). I'm curious how to fix this or if there is an easier way to pull this off.

I appreciate your help, and would be glad to provide log-in credentials.

Thanks,
Josh

#554063

Geeze, I feel dumb. I just used a content template instead and changed the types field to FIELD_VALUE instead of using the raw output and it all started working.

I guess typing it all out gave me the insight I needed... ugh.

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