Tell us what you are trying to do?
I have a custom post type called “presets” and another custom post type called “printers”
‘Printers’ has many fields but also shares the same fields that ‘presets’ has. Is it possible to show and include the data fields from ‘presets’ in printers when a new ‘printers’ posts is created?
Is there any documentation that you are following?
I have become very confused in relationships and relationship forms so I hope you can tell me if this is possible.
Is there a similar example that we can see?
No
What is the link to your site?
I need the fields and field values. I plan to have 3 Printer post types ie Printer 1, Printer 2, Printer 3. Each has unique fields but when creating a new post from each i will pull the fields and values from post 'presets A' a single post created from post type 'presets'
For clarity, the end result will be post Printer 1A, Printer 1B, Printer1C, etc will pull values and fields from post 'presetA'
Post Printer 2A, Printer 2B, Printer2C etc will pull values and fields from post 'presetB'
Bit confusing I appreciate but I hope that explains.
Thank you for the explanation, I believe it is best to use a post relationship here. Are the presets tied to only 1 printer ? or can the presets be assigned to Printer 1 and printer 2?
Presets can be assigned to post type Printer 1 and post type printer 2 and there will be other post type printers too using the same presets in the final usage.
So this seems to me like a many to many relationship. Where printer A can have many different presets and presets can be assigned to many different printers.
Will you be the one setting up the presets to the printers or do you want this to be done through the frontend?
Please let me know as using the relationship is the best approach and you can just pull the information from the various posts on another post.
I will setup the presets in the backend as a post type however the actual posts from it will be updated in the front end by users.
My understanding of relationships was that of child and parent posts ie linking between each and not pulling data. The magic bit you say "you can just pull the information from the various posts on another post" is exactly what I wanted but cannot see how you take data from a post in order to include it in another. I look forward to your tutorial on this. I do hope it is not a repetition of the album and songs tutorial as that is where I have got lost 🙂
Technically you are not pulling the data from another post to store it in another. Its like this, because a printer and a preset are related then you can pull printer A and all of its related presets data onto a page.
So in your case a use will create a document A, then have the option to select Printer A or Printer B, then also select preset A or B correct?
I would like to know the entire scope since now it seems there are 3 Post types involved.
I see now. So each printer is created as a post Type. So a user will create a document in either printer lets say A. Then they can choose a preset from the preset CPT to assign to the document that was created in a Printer?
Hi Shane
Almost there,
I want to be able to set the Printer 1 UK, Printer 2 UK posts to always use the Preset A UK data.
In the same way set the Printer 1 USA, Printer 2 USA posts to always use the Preset B USA data . I may have confused you here and should have called the presets just Preset UK and Preset USA etc.
The scenario is I set up posts from Printer 1 and 2 in the back end calling them UK,USA,DE,FR,SP for each printer type etc for all countries. I can manually edit those posts in the backend to link to the correct Preset country post. The reason the presets need to be as a separate post for each country is that a frontend manager will need to edit the values through a credform for their own country.
We have custom code that then allows a user to clone a printer post (like a template) of their own country and save it as a new post.
Please show me how to pull data from one post into another rather than just setting up post child parent links.
I want to be able to set the Printer 1 UK, Printer 2 UK posts to always use the Preset A UK data.
In the same way set the Printer 1 USA, Printer 2 USA posts to always use the Preset B USA data . I may have confused you here and should have called the presets just Preset UK and Preset USA etc.
Actually you wont be able to set a default preset, unless the preset is a custom field on the printer itself. So the customer will need to select from the list of presets the one they want to use.
You can pull the data from the field of another cpt to store it into this one using custom code but you will need to know the ID of the preset that you want to use.