Skip Navigation

[Resolved] Content Template can not be assigned to more than one post type

This thread is resolved. Here is a description of the problem and solution.

Problem:

I have created a real estate website where there are agents and properties. I want to be able to use the agents field group AND the properties field groups on one template, then use the agents field group on a different template.

Solution:

You can try with "Fields and Text" block, for example:

https://toolset.com/forums/topic/content-template-can-not-be-assigned-to-more-than-one-post-type/#post-2062517

Relevant Documentation:

This support ticket is created 3 years, 9 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 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 2 replies, has 2 voices.

Last updated by sharlaC 3 years, 9 months ago.

Assisted by: Luo Yang.

Author
Posts
#2062055

I am trying to: I have created a real estate website where there are agents and properties. I want to be able to use the agents field group AND the properties field groups on one template, then use the agents field group on a different template. When I pull in agent field groups into the properties content template, it unassigns the agents content template . I need to be able to show a property listing, then have the agents field group fields come in on the side bar of the page so that the user will view a property, then be able to contact the agent directly from that page.

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

I expected to see: It appears fine, but if I go to edit the property listing content template, it drops all of the agent field group fields in there.

Instead, I got: If I assign the template to agents AND properties, it's fine, but when I go check the agents template, it has been unassigned from agents.

#2062517
relationship.JPG

Hello,

You can not assign two content templates to same post type "agents", it will conduct the problem you mentioned above:

If I assign the template to agents AND properties, it's fine, but when I go check the agents template, it has been unassigned from agents.

In this case, since you are using one-to-many relationship between post type "agents" and "properties", so you can display the related "agents" post information in single "properties" post, for example, edit the content template "Sold Properties - FINAL":
hidden link
Add a Toolset "Fields and Text" block, click the button "Add Field or View", choose a field you wanted, in the following dialog window-> Post selection, choose relationship "Agents Properties", see my screenshot relationship.JPG

It will setup the custom shortcode with item attribute, like this:

[wpv-post-link item="@agent-property.parent"]

More help:
https://toolset.com/block-item/fields-and-text/
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/item-attribute/

#2063107

My issue is resolved now. Thank you!