Skip Navigation

[Resolved] Display Speaker in Archive

This support ticket is created 3 years, 8 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 3 replies, has 2 voices.

Last updated by Christian Cox 3 years, 8 months ago.

Assisted by: Christian Cox.

Author
Posts
#1992393
Mouse_Highlight_Overlay_und_Notification_Center.jpg

Hello,
I would like to display the speakers in the archive page, can you please help me?
Thank you, best regards Ivo

#1992683
query-filter.png

Hello, I see you have a post relationship between Topics and Speakers. In the Topics archive, you would like to display a list of related Speakers. I can help you with this, but unfortunately it is not currently possible to design a View inside a WordPress Archive using the Block Editor. Nested Views are not yet supported in the Block Editor, so you must create them using the older Views editor method.

To set up this type of nested list, you must enable the legacy Views editing experience. Go to Toolset > Settings > General tab and turn on the Editing Experience option that enables both the Block editor and the legacy Views experiences. Refresh the page after changing this setting and go to Toolset > Views to create a new View. In the first popup, choose the option "Display all results" and give the View a name like "Speakers for Topic Archive".

You will see the main View editing screen next. In Content Selection, choose the Speakers post type. Scroll down to the Query Filter section and add a new filter for post relationship / repeatable field group owner. Choose the Topic - Speaker relationship, and choose as related items of the current post in the loop (see query-filter.png for an example).

Scroll down to the Loop Editor area and click "Loop Wizard". This is where you will design the list of Speakers. For testing, I suggest you choose something simple like "Unordered list" and insert the Post Title with Link field - this will allow you to test and confirm the View is working as expected. Save the View.

Return to the WordPress Archive editor for Topics and select the Loop block. Insert a View block in the loop and select the existing Speakers for Topic Archive View. Save the archive and visit the archive to verify the related Speaker results are correct. If so, you can return to the View editor screen and use the Loop Wizard again to design the results of the View as you would like. You can click the button to edit the template using the Block Editor. This will allow you to create the loop design in Blocks. However, you cannot create this design or edit this design directly in the WordPress Archive editor. It can only be edited independently.

Let me know if you have questions about this or if it does not work as expected, and I can give you more advice.

#1993261
Mouse_Highlight_Overlay_und_Themen_–_Bildungspass_–_Entwickelt_von_die_Chance_Agentur_gGmbH_und_Edit_View_‹_Bildungspass_–_Entwickelt_von_die_Chance_Agentur_gGmbH_—_WordPress_und_Jahresbericht_2020_IGORA_DE_FINAL_indd___75____GPU-Vorschau_.jpg

Hello,
Thank you very much for the support. It has partially worked. However, two fields are not displayed: Topics and School level.
hidden link
Could you please help me further?

Thanks a lot.
Best regards
Ivo

#1995365

However, two fields are not displayed: Topics and School level.
Are these two fields in the Speaker post or in the Topic post? I assume they are both in the Topic post based on the screenshot "Mouse_Highlight_Overlay_und_Notification_Center.jpg". In a View of Speakers, if you want to display custom field information from the parent Topic, you must use the item="@relationship-slug.parent" syntax in the Types field shortcode:

[types field="schulstufe" item="@relationship-slug.parent"][/types]

Replace relationship-slug with the slug of the Topic-Speaker relationship. If you do not include the item attribute, the custom field shortcode expects to display information from the current Speaker post, which is incorrect.

Item attribute documentation: https://toolset.com/documentation/programmer-reference/views/views-shortcodes/item-attribute/
Types Field API documentation: https://toolset.com/documentation/customizing-sites-using-php/functions/