Skip Navigation

[Resolved] Assigning a content template via link parameter

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

This topic contains 3 replies, has 2 voices.

Last updated by Shane 7 years, 2 months ago.

Assisted by: Shane.

Author
Posts
#575870
Get Through to Hard to Reach Prospects – Sales Excellence University (1).png
Sales Excellence University – On Demand Sales Training (1) (1).png

I am trying to assign a different content template to a views shortcode by passing a parameter to it, as described in this post: https://toolset.com/forums/topic/use-a-fields-table-how-to-use/

I have 2 different Content Templates that I would like to use, but since you can only assign one template to a CPT, I can't get it to load the 2nd content template using this code in a view:

<a class="video-link" href="[wpv-post-url]?view-template=content-template-for-weekly-videos">[wpv-post-title]</a>

Link to a page where the issue can be seen: hidden link

I expected to see: When I click on any of the post links in "More Weekly Videos", I expected to see the post loaded using my content template "Content Template for Weekly Videos"

Instead, I got: The post content loaded into the main content template "Content Template for Training Videos"

#575882

Shane
Supporter

Languages: English (English )

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

Hi Michael,

Thank you for contacting our support forum.

I see that you made reference to a very old post and its actually not possible to dynamically allocate a content template to a post.

That is because the content template information is actually saved into a hidden custom field on the post so that views can know which content template to load.

Thanks,
Shane

#576684

Can you think of any way to achieve this? I don't want to create a whole new CPT with duplicate content just to be able to use a different content template.

#576706

Shane
Supporter

Languages: English (English )

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

Hi Michael,

Any way to achieve this would require some custom coding and because the information would need to be loaded from the database.

This would fall out of the scope of our support forum as per our support policy as it deviates from the normal usage of the plugin.

However we do have an option where you can contact one of our certified partners for any custom coding needs.

https://toolset.com/consultant/

Thanks,
Shane