Skip Navigation

[Resolved] Use Content Template inside a View

This support ticket is created 2 years, 6 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.

Our next available supporter will start replying to tickets in about 2.08 hours from now. Thank you for your understanding.

This topic contains 2 replies, has 2 voices.

Last updated by aaronM-9 2 years, 6 months ago.

Author
Posts
#2187139

Would it be possible to and/or acceptable practice to use a Content Template to format the results of a View? I have several views that need to output lists of posts, and it would be nice to only have to update one template instead of all the separate views.

I did try creating a content template but when I tried to add a featured image, I realized it was only giving me Pages as available sources of data, not Posts. I did not select any post types to use with the content template, since I do not want this to be the standard template that's used for single pages.

Thanks for any advice.

- Aaron

#2187469

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Hi Aaron

You can do this, but the dynamic source options offered in the editor are based on what post is used for the preview (which you can change at the top of the page).

If you are previewing the template with a page, pages don't have featured images, and hence featured image would not be available.

Choose a post for the preview that includes the fields you will want to choose as dynamic sources in the template.

If you are still having problems, you may find that you need to temporarily assign the template to the post types used by the Views purely while editing the template, and then you can remove the assignment before saving the template.

#2187723

Excellent, thanks. I just had to trick it into showing me the right options by temporarily changing the post type. Thanks.

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