How to set the TaxonomyContentItemId using migrations #10196
Unanswered
MikeAlhayek
asked this question in
Q&A
Replies: 1 comment
-
The thing I do is write recipe for that taxonomy and hardcode contentItemId in a const project (module) that has no references so everyone (every other module) can use it. If site is new, I create taxonomy on dev machine and export and save that recipe by transforming it into migration class. That's my way, would like to hear from others too... |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to create a content-type called
Inventory
which is constructed usingTitlePart
andInventoryPart
. TheInventoryPart
will have multipleTaxonomyField
each will reference a different Taxonomy like (Maker, Model, Color, Fuel type, Body Style, etc)I am trying to figure out how to correctly use migration to create a Taxonomy field and associate it with taxonomy-content-item. Unless I am mistaken, the property
TaxonomyContentItemId
in theTaxonomyFieldSettings
needs to be set to theTaxonomyFieldSettings
. Is this the way to get it done or not?If so, how can I use the migration to create
TaxonomyContentItem
using a migration to get the id? Also, how can I add the initial list of taxonomy terms to the item using the migration? Perhaps, migrations is not the way to add theTaxonomyContentItem
and the initial list of terms? Is deployment steps more appropriate for this? Is so, how can I ensure that deployment steps run before the migration?Here is what is my migration so far.
Beta Was this translation helpful? Give feedback.
All reactions