Limit tag control to only tags used by particular module
Is there a way to limit the tags control to only display tags used by a particular module? If so, how?
I've created a custom module with the Module Builder. The tags control is great for quickly putting together a filter for its list view, but in order to really make it useful I need to be able to filter the tags too.
Looking at the DynamicModulesConfig.config file, you might be able to change the taxonomyId property that is set for the tags. Maybe change it to a different taxonomy that you created through the taxonomy section. You could create a taxonomy and call it your module name. Then get the id by using the api or a tool like firbug to inspect the json that is sent back when the taxonomy section is populated.
Julia,
if you are referring to the Taxonomy widget, I believe there is currently a known issue with filtering based on a custom module type for the built in taxonomy types (Category, Tag, etc).
Richard's suggestion of using a custom taxonomy type is a valid one. If you make a custom taxonomy type for exclusive use by your dynamic module, and set the taxonomy widget to use that type, it will work as you expect.
Gabe demonstrated this in the recent Module Builder Webinar
If, however, you want to use the built-in taxonomy types, a temporary workaround is to make a custom taxonomy control that inherits from the built-in one, and allows you to specify a dynamic type.
Simply add this class to your project:
public
class
DynamicModuleTaxonomyControl : TaxonomyControl
public
string
DynamicModuleType
get
;
set
;
protected
override
void
CreateChildControls()
Type showcaseType = TypeResolutionService.ResolveType(DynamicModuleType);
this
.ContentType = showcaseType;
base
.CreateChildControls();
Great! Any ideas for how to sort the tags listed?