1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Adding Taxonomy to intra-site modules?

Adding Taxonomy to intra-site modules?

3 posts, 0 answered
  1. Simon
    Simon avatar
    10 posts
    Registered:
    08 Jun 2012
    27 Jun 2012
    Link to this post
    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?
  2. Slavo
    Slavo avatar
    295 posts
    Registered:
    24 Sep 2012
    03 Jul 2012
    Link to this post
    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.

    All the best,
    Slavo
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    09 Jul 2012
    Link to this post
    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!
3 posts, 0 answered