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.
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/
My issue is resolved now. Thank you!