Products sample questions
Hello.
I just created custom module based on Products sample from the SDK.
I would like to add the following some functionality:
In the backend “Grid View Mode” I want add one more column representing, lest say, products color. Products color field tied to the “Colors” taxonomy. In my case it is single choice. If it is possible, could you please provide code sample how to add such column.
Also, I would like to add filtration functionality by color in the side bar. My experiments didn’t work. In the definitions file I found place where “filter by tags” option is added. I simply tried to replace "Tags" taxonomy id with the "Colors" taxonomy id:
var clientTemplateBuilder = new System.Text.StringBuilder(); clientTemplateBuilder.Append(@"<a href=""javascript:void(0);"" class=""sf_binderCommand_filterByTag"); clientTemplateBuilder.Append(@""">Title</a> <span class='sfCount'>(ItemsCount)</span>"); var tagFilterWidget = new DynamicCommandWidgetElement(tagFilterSection.Items) Name = "TagFilter", CommandName = "filterByTag", PageSize = 10, WidgetType = typeof(DynamicCommandWidget), IsSeparator = false, BindTo = BindCommandListTo.Client, //I modified next line BaseServiceUrl = String.Format("~/Sitefinity/Services/Taxonomies/FlatTaxon.svc/0/", "8B121C60-692F-45B3-8E87-05D35F696E92"), ResourceClassId = typeof(Labels).Name, MoreLinkText = "ShowMoreTags", MoreLinkCssClass = "sfShowMore", LessLinkText = "ShowLessTags", LessLinkCssClass = "sfShowMore", SelectedItemCssClass = "sfSel", ClientItemTemplate = clientTemplateBuilder.ToString() ; tagFilterWidget.UrlParameters.Add("itemType", typeof(PortfolioItem).AssemblyQualifiedName); tagFilterSection.Items.Add(tagFilterWidget);... DefinitionsHelper.CreateTaxonomyLink( new Guid("8B121C60-692F-45B3-8E87-05D35F696E92"), //And this line DefinitionsHelper.HideSectionsExceptCommandName, DefinitionsHelper.ConstructDisplaySectionsCommandArgument(tagFilterSection.WrapperTagId), sidebarSection);