Skip Navigation

[Résolu] render_view_template does not allow to display content any longer

This support ticket is created Il y a 8 années et 11 mois. 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 8:00 – 17:00 8:00 – 17:00 8:00 – 17:00 8:00 – 17:00 8:00 – 17:00 -
- - - - - - -

Supporter timezone: America/Sao_Paulo (GMT-03:00)

Marqué : 

This topic contains 51 réponses, has 6 voix.

Last updated by simonE-3 Il y a 8 années et 8 mois.

Assisted by: Adriano.

Auteur
Publications
#317064

Shane,
please have the devs take this seriously, it has been a month since the ticket was openned. we got no support so far.
please connect us directly with development.

#317257

Sahne? Caridad?

#317268

Shane
Supporter

Languages: Anglais (English )

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

Hi Simon,

Just to give an update.

I see where the escalated ticket has been brought to the attention of senior developer.

We are currently waiting for feedback from the developer as well in order to get an understanding of what is happening here.

Thanks

#317309

so... after having this open since May 12, this is two months, can we get in touch with a developer directly?

#317357

Shane
Supporter

Languages: Anglais (English )

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

Hi Simon,

We have heard news from the dev, he wasn't able to replicate the issue.

Could you setup a demo for us where we can clearly see the issue replicated by you.

This will certainly help with identifying the issue at hand.

I will be enabling the private fields so that you can provide me with the access details to pass to the developer so he can look at the replicated issue.

Please mention the links were the issue has been replicated.

Thanks

#317522

Shane
Supporter

Languages: Anglais (English )

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

Hi Simon,

As mentioned previously our developer was not able to replicate the issue on your website.

To help speed this up could you replicate the issue and point us to page/pages where the issue has been replicated.

This way I can advise our dev where to look and hopefully find whats wrong.

Thanks

#317532
present.jpg
missing.jpg

Hi shane,
Please see this page: hidden link

there should be a view between "Killer Kit Awards" and "In My Bag" (and a few other views too).

It is the same one that is shown here: hidden link
(see screenshots for better visualization)

#317608

Shane
Supporter

Languages: Anglais (English )

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

Hi Simon,

Our developer went in and had a look at the website and this was his comment:

In the case of a Content Template that should be rendered, edited here:
hidden link
it seems that the CT is empty, so it rightfuly outputs nothing. I added a dummy text "CT content", and it is completely shown.

Regarding the View, edited here:
hidden link
it has a filter "Select posts that are a children of the Post set by parent View.". As this is not a nested View, it is also returning nothing. I have added a dummy text to the loop output using the shortcode to count results. This might have been triggered by an update, since one of the last releases forced that filters depending on nested Views return nothing when the View is not actually nested.

Complete results can be found here:
hidden link
under the Killer Kit Awards title.

Also the ftp credentials don't work.

Thanks

#317778

Hi shane,

our template does the following:

/* ---------------------- Load Photographer ----------------------------*/
$thispost = get_post('%%postid%%');
echo render_view_template('8581', $thispost);
/* ----------------------- Display a view ---------------------------*/
[wpv-view name="phr-Gear-MostFavorite"]

so the 'correct post', i.e. the one with children is loaded before we call the view. this used to work until the update in question.

Please have a developer look at this today. or have us work with a developer directly.

#318217

Shane
Supporter

Languages: Anglais (English )

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

Hi Simon,

I've passed the information onto our developers.

Thanks

#318472

Juan
Supporter

Timezone: Europe/Madrid (GMT+02:00)

gcb-2.png
gcb-1.png

Hi Simon

This is Juan here, lead Views developer. After checking that there is no issue between what your site produces and what I would xpect it to produce, and as you obviously disagree, I was wondering if we migth be missing something here. And I have an idea that might explain that.

Let me recap, and excuse if I get too long.

You have a render_view_template() call. It is loading a Content Template and applying it to a post wich ID you are getting from the Global Content Blocks shortcode, in form of a %%postid%% variable.

You are doing this not because you want to load the Content Template, which is empty (so it rightful outputs nothing), but because you want to set some post data that the View shortcode below it should be using. This is what "Load Photographer" means: load this photographer post, without displaying anything on a Content Template so its data is then used by the View below. Right?

Now, that wpv-view shortcode is loading a View that has a filter that expects some data to be set on a parent View, right? It has a filter to return posts that are children of the post set on the parent View. And you assume, because it worked before, that the parent View is the data that the render_view_template is setting, meaning the View will load posts that are children of the photographer with ID the %%postid%% value that you got from the Global Content Blocks shortcode.

So, as a summary: you are loading an empty Content Template to set a photographer that should be used as ID set by the parent View on a query filter of another View.
------------------------

That is the explanation of the situation, if I am not wrong.

Now, the issue is that this filter data, "Select post that are chldren of the post set by a parent View" only works on nested Views. The fact that you are setting the photographer using a Content Template does not set a parent View at all. In the past, that hapened, and we considered it a bug, and changed how it works. From now on, filters that demand data from the parent View will only work with real nested Views.

But this should not be a problem to you. I am offering you a solution.

* First, please do not load an empty Content Template. It is not needed anywhere. So every call that you are making to

echo render_view_template('8581', $thispost);

is useless because the Content Template with ID 8581 is empty. So in fact the Content Block "COD, Phr - Load Photographer by ID" is, well, useless and I recommend you to not use it anymore anywhere. I am attaching a screenshot of the change I have done on the Content Block "COD, Phr - Most Favorite Gear" and you will notice that I have passed the %%postid%% directly to the wpv-view shortcode in the attribute "wpvprchildof"

* Second, you can set the parent photographer directly into the View to render its "Photographers-Gears" children. Notice that we used the attribute"wpvprchildof" before? I am attaching a screenshot of the filter in the "phr-Gear-MostFavorite" View so you can notice how I used it.

I think the results are what you would expect. Here:
hidden link
under the "Killer Kit Awards" title, you can see what I assume is what you expect.

Please let me know if you need any further explanation, and if this solves your issue. Also, please acept my apologies for this issue, as it has taken too long to completely understand it and offer a solution.

Hope this all helped a little 🙂

Regards

#318482

Hi Juan,
Thanks for stepping in, and thanks for the help!

I tried doing the same with the phr-Gear.vw
and it worked for this page: hidden link
however when I tried accessing this page: hidden link
it crashed the server.
any idea why?

Lets use the momentum to fix this once and for all.

#318490

Juan
Supporter

Timezone: Europe/Madrid (GMT+02:00)

Hi Simon

It seems that Photograpehrs are using a Content Template named "

Inside it, you had two Views. One is the one I edited, so I changed the shortcode to be:

[wpv-view name="phr-Gear-MostFavorite" wpvprchildof="[wpv-post-id]"]

The other one was the one you mention, "phr-Gear.vw". I also edited it to get the photograpehr ID from a shortcode attribute, so it is also finally:

[wpv-view name="phr-Gear.vw" wpvprchildof="[wpv-post-id]"]

You should review any other places where you are using those Views, and recheck that they are getting the right value in the wpvprchildof attribute. Other than that, it seems that now this page is working nicely:
hidden link

Please do not close this until you have checked that everything is as it should, I will be helping you for as long as you need 🙂

Regards.

#318505

wonderful thanks, let me go over all the content blocks and all the views and templates and fix this 🙂

#319915

Hi Juan,
Thanks for all the pointers and help. It took some time, but I think I got them all.
the only one that I am struggling with is this one that is used to compare photographers:
hidden link

there are several nesting inside a loop and it is not working yet. can you have a look?

thanks,
udi

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