Adding Taxonomy to intra-site modules?
Following the Testimonials Intra-site Module -- how do you add the taxonomy to an intra-site module? Ideally I want it to mimic the same way that a module builder would have. I don't want to "recreate the wheel" by creating that taxonomy selector widget.
also how do you create the necessary tables/mapping that when the "testimonial" module is initially installed or update an existing module?
Hi Simon,
Taxonomies are associated with module items through custom fields. This is both true for built-in modules and custom modules. An example Color taxonomy is implemented in the Products Module in the SDK.
You don't need to implement a selector from scratch. Instead, you can use either HierarchicalTaxonField or FlatTaxonField.
As for upgrades and mappings, I've replied in your other forum thread.
Simon,
if you are creating an intra-site module with your own data model, you're likely not inheriting from Content which is required if you wish to extend your model with custom fields like Taxonomy.
This unfortunately is a limitation of working with your own model instead of inheriting from Content (or better yet, using the Module Builder)
However, it is possible to create your own link table that associates your custom item ID with the taxonomyIDs from Sitefinity. This isn't a full integration (more of a hack really) but it does allow you to use the existing taxonomy items and associate them manually with your custom data.
This is still limiting, however, since the TaxonomyField is not designed to work outside of a Content-based module designer.
I've worked around this by building my own Tags selector using an asp.net CheckboxList. if you are interested I can perhaps write up a blog post that demonstrates how I did this.
You may find however that the Module Builder (which has improved immensely since the introduction of intra-site modules) might be a better fit for your needs
hope this is helpful!