Skip Navigation

[Resolved] Upgrading Types from 1.8.11 brother pages issue

This support ticket is created 8 years 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
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 18 replies, has 3 voices.

Last updated by Guillaume 7 years, 11 months ago.

Assisted by: Beda.

Author
Posts
#388399
types1811.png

Hello,
i follow this guide to select my brother pages...

https://toolset.com/documentation/user-guides/displaying-brother-pages/

Everything worked fine with types 1.8.11 and views 1.10.1
Upgrading to types 1.9 or superior broke the compatibility.

hidden link

on this page, the top of sidebar should display others artist shows, but i have a nice « pas de resultats » .
could you help me ?
thanks

#388731

Itamar
Supporter

Languages: English (English )

Timezone: Asia/Jerusalem (GMT+03:00)

Hello, Guillaume.

Thanks for contacting us here at Toolset support forum.
I will try to help solve this problem.

If you get the 'No results' (pas de resultats) message that means that something is wrong with the filtering and conditions set on this view or that there no items to return.

This is what I would do to solve this problem:
- Create a new test view to get the results you want like the original (currently problematic) view. But at the beginning add no queries, filters, and conditionals.
- Check and see the outcome on the front end. You should expectedly get all results.
- Start to add back one by one any queries, filters, and conditionals that you had in the original view.
- Check after each new adding to see which is the one that causes the problem.
- Then when you find it understand what is wrong with it and fix.
- After you get it fixed, you can get this new view in place of the broken one.

Please let me know if the above solution works for you, I look forward to your reply!

Thanks,
Itamar.

#388988

hey,
in this page, i try to display other dates of the same show, but no results.

hidden link

in a text widget of the sidebar...

[wpv-post-body id="$spectacle" view_template="content-template-for-other-dates"]

in the "content-template-for-other-dates"
i call the view

[wpv-view name="View_other_dates"]

with no filtering, i see all the dates about all the shows (spectacles)

with...

Select posts that are a children of the current post in the loop.

no results, but it’s ok with my old install

i try also "Post where this View is shown » with the same no results

or "Select posts whose parent is the page where the View is shown."

or "Select posts whose parent is the current post in the loop."

i missed something ?
thanks
Guillaume

#389677

Itamar
Supporter

Languages: English (English )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi.

Glad to hear that it works now.

With your second question maybe the problem lies with the PHP variable that you have put inside the shortcode. I don't think it will work like that.

But as the original issue is resolved may I kindly ask you please to open a new ticket for your additional question and mark this thread as resolved?

Posting a new thread for each issue helps not only supporters to focus on one issue at once, but also enables other users to find solutions to their questions faster.

You will be able to choose me as your supporter for that next issue that you have or choose any other available supporter.

Please follow this link for our support request guidelines:
https://toolset.com/toolset-support-policy/#support-request-guidelines

Thank you for your understanding.

Thanks,
Itamar.

#389678

hello,
no, it doesn't work... i can't display my brothers post...
it's not a new question, but the same problem on an other page.

#390448

Itamar
Supporter

Languages: English (English )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi, Guillaume.

I'm so sorry for this.
I didn't understand you are still experiencing the problem.
I'm also sorry for the late response.

Let me please check things thoroughly and come back to as soon as possible.

Thank you for your patience.

Thanks,
Itamar.

#390696

Itamar
Supporter

Languages: English (English )

Timezone: Asia/Jerusalem (GMT+03:00)

page-attributes.jpg
hierarchical.jpg
attributes-in-post.jpg

Hello, Guillaume.

Thank you again for your patience.

What I'm going to describe here in details is the process described in the Displaying Brother Pages tutorial at this link:
https://toolset.com/documentation/user-guides/displaying-brother-pages/

That is the tutorial you have stated that you were trying to follow.
I must admit that this tutorial may not be clear enough and needs new editing.
I've talked to the person who is in charged for our documentation and it will be corrected.

Before I proceed, I would like to to point out before you that there is another method to achieve similar results and it all depends on the way your custom post types are structured.
The other method is Displaying Related Child Posts, and it is described here:
https://toolset.com/documentation/user-guides/displaying-related-child-posts/

I quote here what is highlighted at the beginning of the Displaying Brother Pages tutorial.
"Please note that these instructions are meant for hierarchical custom post types, which behave in the same way as the standard Pages in WordPress."
This is a very important note and for Types custom post types you will need to enable this option.

This is what I did to make it work:
1. Create a CPT: Toolset => Post Types => Add New
2. Give it a name. Plural and Singular. I will use here Shows/Show as the name.
3. Scroll down to the 'Sections to display when editing Show CPT'.
4. Check the 'Page Attributes' checkbox. Please see screenshot page-attributes.jpg
5. Scroll further down to the 'Options' section and check the 'hierarchical' checkbox. Please see screenshot hierarchical.jpg

Those above two steps make a Types CPT have a hierarchical behaviour like regular WordPress pages.
Hierarchical behaviour means you will be able to declare a parent post for any one of the 'Shows' CPT posts.
The parent post could only be one of the posts from the 'Shows' CPT.
A parent could not be any other post or page outside the 'Shows' CPT.
A post can have one parent but a parent can have many children posts.
Enabling this will add the 'Attribute' section to each post from the "shows' CPT. Please see screenshot attributes-in-post.jpg

6. Save your new CPT.
7. Create your 'Show' posts.
8. Choose one of the 'Shows' posts to be the parent and then assign every other 'Show' post to be a child of that parent post.
9. Create the Content Template for your single 'Show' post and assign it to all your 'Shows' posts. Design this content template the way you want.
10. Create another Content Template you can call it 'Tutorials Sidebar Parent' like in the tutorial. For now, leave it empty. You will later call it from the text widget in the sidebar.
11. Create a view and call it 'List Children Of The Parent Page' or any other name.
12. In the 'Content Selection' part select your 'Shows' CPT.
13. In the 'Query Filter' part add a filter and choose 'Post parent' from 'Select what to filter by:'
14. Check the 'Parent is the current post in the loop' radio button and save the filter.
15. In the views 'Loop output' section insert the [wpv-post-link] field shortcode and save your view.
16. Insert the view you have just created in the 'Tutorials Sidebar Parent' content template you have created before. The shortcode should look like this:

[wpv-view name="list-children-of-the-parent-page"]

17. In a text widget on the sidebar insert the following shortcode:

<div>[wpv-post-body view_template="Tutorials Sidebar Parent" id="$parent"]</div>

18. Save your text widget and watch in the sidebar of each 'Show' post the brother posts of it.

A crucial thing to know is that to you have to use the $parent like it is.
$parent calls the parent page/post for what is configured as a ​default WordPress relationship. In steps four and five, that's what we did. In this case, you do not use $slug ($spectacle like you did). You can read a detailed explanation about it in a different thread here:
https://toolset.com/forums/topic/taxonomy-post-order-andor-conditional-statement-against-current-post/#post-374839

Please let me know if the above solution works for you, I look forward to your reply!

Thanks,
Itamar.

#392113

Hello,
i apologize because i used the other method to Displaying Related Child Posts and all was running fine with Types 1.8.11 and Views 1.10.1
Upgrading to View 2.0 is ok, but the problem come with Types 1.9 and after...
i don't understand why my query "Select posts that are a children of the current post in the loop" don't give any results.
The method you describe with page attribute/hierarchical check seem to me more complicated because it forces to re-edit all my previous Shows and Dates.
thanks for your help.
Guillaume

#392509

I apologize the delay here.

I am currently awaiting some updates of a possible BUG in this setup, when the View is used in a Widget.

But I am not able to reproduce this problem locally at all.

It seems to be a edge case.

Can I gain login access and exact instructions on where I find the Data you display and the related Views?

Thank you

#392879

Can you try this:

[wpv-post-body id="[wpv-post-field name='_wpcf_belongs_ artiste_id']" view_template="content-template-for-other-spectacles"]

Instead of the (which you currently use) $artiste call, we use the hidden Field that tells what parent to call.

Does that Work?

If not, I'll debug it further on your site.

If I need to do so, am I allowed to make changes to the code, and disable/enable Plugins and Theme?

#392890

This code give the same "no results"... and "no results" too when i put it inside the post body unlike the other code that works.
yes, you can make test on the site, i made a total backup.
thanks

#392919

I renamed the Widget to "Toolset Test" for ease.

In your View that you call there, you want to display Spectacles that are Child of the Current Post in the Loop.

Since this View is not inserted in any loop at all, it won't work.

Further More you insert the Widget in a Post that is already Spectacle.
How should a Child of Spectacle be a Spectacle? This is not possible.

You want to display BortherPages so you need to query Posts who's Parent is the Current Page.
Not the Types relationship but the WordPress native relation.

Furthermore you do not show the Page Attributes Box on your Spectacle Post Type, how can you set a parent for it, if you don't show it? Brother pages are meant to be Brother pages in the same post type therefore you need to set a Parent Post of the same type and that's done with this meta box.

This is the process to display BROTHER PAGES:
https://toolset.com/documentation/user-guides/displaying-brother-pages/

As you see it is intended to display Posts that are Child of a post in the SAME post type, set by the WordPress native Parent relationship

This here instead is the DOC to display Children of Post, set by Types.
For this you need 2 post types, and one is child to another.
https://toolset.com/documentation/user-guides/displaying-related-child-posts/

Those are 2 different things.

And both world fine, if set up correctly, as I tested locally.

If you want to display BROTHER pages you need to change your setup, and if you want to display Children Posts set by types, you need to change the way your View queries content to display the Children of the Post where this View is inserted, instead of the Post in the Loop.

Thank you

#392967

i don' t understand your answer.

the query is OK if i put it out of the sidebar...
if i paste [wpv-post-body id="$artiste" view_template="content-template-for-other-spectacles"] inside a "spectacle" (shows) entry body, i see the other shows of the artist
"spectacle" is a child of "artist"... "date" is child of "spectacle".
I insert the Widget in a Post that is already Spectacle, but i do this thru [wpv-post-body id="$artiste" view_template="content-template-for-other-spectacles"]... this have a sens for me and was working previously 🙁
The method is the same as described here :
https://toolset.com/documentation/user-guides/displaying-brother-pages/
or i've missed a precious step.
thanks

#393217

It's not the same.

Brother pages are pages, or posts, which are Hierarchical.

For this top work, you need either Native WordPress pages, or, your Custom Post Type must be hierarchical and the Page Attributes Meta Box must be displayed in the Post Edit Interface.

Then, when you create Pages or Posts, you choose a direct Parent Page or Post to the content you actually edit or create.

Those Parents are of the SAME post Type.
So that means, a Page is parent of another page (or in case of Custom post Types, a post is parent of another post in the same post type)

When you then display a certain Page you can with views also display it's Child page and the "brothers" of that Child page
This process is what we describe here:
https://toolset.com/documentation/user-guides/displaying-brother-pages/

Now, when you set up a post Relationship with Types Plugin, means, a Post Type A is parent or Child of a Post Type B, then you do not use the above approach, but the approach described here:
https://toolset.com/documentation/user-guides/displaying-related-child-posts/

The difference in the Views Query is, that you Query Filter by "Select post with parent:" in the case of Hierarchical Post Types (like pages, when you have Brother Pages)
In the case of Post Relationships created with types, you would Query Filter by "Select posts that are children of..."

To me it seems you want to display as you mention "Brother pages"
Brother pages are in the SAME post type.

No other Post Types are involved in our Documentation for this approach.
We always use id="$parent" or id="current_page" and never id="$your-post-type-slug"

If you want to read a huge elaboration of mine regarding the above difference, this one is great:
https://toolset.com/forums/topic/taxonomy-post-order-andor-conditional-statement-against-current-post/#post-374839

So, can you let me know what you want to do.

Display posts that are Child to a page/post in the SAME post type
OR, display Posts that are Child to a parent in ANOTHER post type.

Thank you

#393222

parents and child didn't have the same type...
Artistes - Spectacles - Dates
Look at this page :
hidden link
i put the shortcode ...
[wpv-post-body id="$artiste" view_template="content-template-for-other-spectacles"]
inside the body text, under the image and it's running perfectly.
i call the parent body (artiste), select all the childs (spectacles) and isolate the current child on screen... like in your tutorial... no ?

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