Skip Navigation

[Resolved] Loading view from another site

This support ticket is created 4 years, 7 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
- 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)

Tagged: 

This topic contains 4 replies, has 2 voices.

Last updated by johnG-18 4 years, 7 months ago.

Assisted by: Shane.

Author
Posts
#1928665

Tell us what you are trying to do?
I have a view and custom field types on one hosting provider. I have a production site on another hosting provider. I want to pull the data from one site to the production site.

Is there any documentation that you are following?
I know about this thread (https://toolset.com/forums/topic/loading-a-view-from-one-site-on-another-in-wordpress-multisite/) but some things I don't understand.

1. How do you call the data site in the code? Do you use the database name?
2. Does this use the view on the production site or the data site?
3. Does https matter? One site is https and one is http.

Is there a similar example that we can see?

What is the link to your site?

#1928751

Shane
Supporter

Languages: English (English )

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

Hi John,

Thank you for getting in touch.

As you know Toolset doesn't support Multisite cross site sharing. A view created on one site is limited to use on that site.

What Luo has done was to write a script that will allow this, however given that this is custom code this is not supported under our Toolset support policy.

However let me answer your questions.
1. How do you call the data site in the code? Do you use the database name?

Based on Luo's example the code is called with a shortcode and the view name.

[switch_to_blog bid="3"]
Here display target subsite3 contents:
[wpv-view name="item-list"]
[/switch_to_blog]

BID = "3" is the ID of the multisite that you want to pull the view from. [wpv-view name="item-list"] is the name of the view on Blog 3

2. Does this use the view on the production site or the data site?
No this won't use the data on the production site as it is essentially just pulling the data from the site it was created on.

3. Does https matter? One site is https and one is http.

I dont believe this will.

The best plan of action here is to export the view from one multisite instance to the other rather than doing it in the example above.

Please let me know if this helps.

#1928791

Thanks. Where is BID set? Or, can you use something other than a number here?

#1930233

Shane
Supporter

Languages: English (English )

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

Hi John,

You will need to use the ID. As mentioned this is custom coding and is not supported by our Forums so I cannot guarantee that it will work.

However to find the ID from the Network Admin, go to Sites > All Sites. When click to edit a site you'll be taken to a URL. The ID should be in the URL.

Thanks,
Shane

#1930411

My issue is resolved now. Thank you!