Skip Navigation

[Resolved] Show related post in template

This support ticket is created 4 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
- 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 10 replies, has 2 voices.

Last updated by dzemalN 4 years ago.

Assisted by: Shane.

Author
Posts
#1904587

I want on courses template single page, show other courses from the same teacher.
On teacher page i'm listing all courses related to that teacher. See picture below.
hidden link

Than when click on some course i will display that course, display current teacher and display other courses from that teacher.
See picture below.
hidden link

But i don't know how to do that. Can you please assist on that?

#1905089

Anybody can help me with this issue?

#1905545

Shane
Supporter

Languages: English (English )

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

Hello,

Thank you for getting in touch.

Currently I dont believe this is possible to do with our Blocks setup. However it can be done with the classic views editor in blocks.
https://toolset.com/documentation/legacy-features/views-plugin/displaying-brother-pages/

To enable the classic editor go to Toolset-> Settings and scroll to editing experience then select the third option.

Once you've done this just refresh the page and you should see the option Toolset -> Views.

Thanks,
Shane

#1907829

Hi Shane,
i have enabled Views but i can't find out how to make it.
Is there any query filter to do that?

#1909407

Shane
Supporter

Languages: English (English )

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

Hello,

Yes there is a query filter for it.

Have you checked out the tutorial in the link below?
https://toolset.com/documentation/legacy-features/views-plugin/displaying-brother-pages/

This should walk you through the steps as well as the query filters that are needed. Is there a particular section of the Tutorial that you are not clear on ?

If so you can let me know and I can provide further clarity for you.

Thanks,
Shane

#1909549

Dear Shane,
i can't find where to place shortcode like in that tutorial you sent me.
This is step 2 and picture "Shortcode of Content Template that will display the parent page"
My editor is looking different and i don't know how to enable shortcode.

My code looks more like this if i change from Visual to Code editor:

<!-- wp:toolset-views/view-editor {"reduxStoreId":"views-editor-1610929071839","viewId":1832,"viewSlug":"alphabet","previewId":1833,"focused":false,"insertExisting":"0","wizardDone":true,"wizardStep":3} -->
<div class="wp-block-toolset-views-view-editor wpv-gutenberg-view-wrapper-1832"><!-- wp:toolset-views/view-layout-block -->
<!-- wp:toolset-views/view-template-block {"storeId":"views-editor-1610927733906","style":{"cssClasses":[]}} -->
<div class="wp-block-toolset-views-view-template-block wpv-block-loop-item php-to-be-replaced-with-shortcode" data-toolset-views-view-template-block="1"><!-- wp:toolset-blocks/heading {"dynamic":{"content":{"isActive":true,"provider":"__current_post","source":"post-title-with-link"}}} -->
[tb-dynamic-container provider='__current_post' source='post-title-with-link' field='']<h2 class="tb-heading" data-toolset-blocks-heading="1" data-last-update="1.4">[tb-dynamic provider='__current_post' post='current' source='post-title-with-link' force-string='first' ]</h2>[/tb-dynamic-container]
<!-- /wp:toolset-blocks/heading --></div>
<!-- /wp:toolset-views/view-template-block -->
<!-- /wp:toolset-views/view-layout-block --></div>
<!-- /wp:toolset-views/view-editor -->

And if i try to manipulate with shortcode than it will recover to original view and do not let me do that you suggesting me in tutorial. 🙁

#1909639

Shane
Supporter

Languages: English (English )

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

Hello,

Given that the blocks interface is being used to create the content template, the workaround to using the shortcode is to use the wordpress Classic block and then using the fields and views button on the classic editor block to add your view.

From there switch the classic editor block to HTML mode and you should be able to edit the shortcode to add the correct parameter that is required.

If you need my help on this, what you can do is to provide the admin credentials as well as a link to the page so that I can have a look.

Thanks,
Shane

#1914697

Shane
Supporter

Languages: English (English )

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

Hello,

Thank you for your patience, if you have a look at this view here you can see how i've set it up to display the brother pages.
hidden link

I've added it to the courses template using the shortcode below.
<p>[wpv-view name="list-related-courses" wpvrelatedto="[wpv-post-id item='@ddu.child']"]</p>

Passing in the ID of the parent using [wpv-post-id item='@ddu.child']

You should be able to go in and style the view how you want it.

In part 2 all that is needed to display the parent information is to in your classic view for the courses just use this shortcode below to get the parent post title.
[wpv-post-title item='@ddu.child']

Please let me know if this helps.
Thanks,
Shane

#1915143

Thank you Shane,
i will study your code and let you know if everything is as it should so we can close the topic.

#1915239

Shane
Supporter

Languages: English (English )

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

Hello,

Happy I was able to assist you with this one.

Once you can verify that there are no issues then you can go ahead and mark this ticket as resolved.

Thanks,
Shane

#1917141

My issue is resolved now. Thank you!