private static NavigationConfig GetNavigationConfiguration(Component navConfigComponent) { NavigationConfig result = new NavigationConfig { NavType = NavigationType.Simple }; if (navConfigComponent.Metadata == null) { return(result); } ItemFields navConfigComponentMetadataFields = new ItemFields(navConfigComponent.Metadata, navConfigComponent.MetadataSchema); Keyword type = navConfigComponentMetadataFields.GetKeywordValue("navigationType"); switch (type.Key.ToLower()) { case "localizable": result.NavType = NavigationType.Localizable; break; } string navTextFields = navConfigComponentMetadataFields.GetSingleFieldValue("navigationTextFieldPaths"); if (!string.IsNullOrEmpty(navTextFields)) { result.NavTextFieldPaths = navTextFields.Split(',').Select(s => s.Trim()).ToList(); } result.ExternalUrlTemplate = navConfigComponentMetadataFields.GetSingleFieldValue("externalLinkTemplate"); return(result); }
private static NavigationConfig LoadConfig(Component component) { NavigationConfig res = new NavigationConfig { NavType = NavigationType.Simple }; if (component.Metadata != null) { ItemFields meta = new ItemFields(component.Metadata, component.MetadataSchema); Keyword type = meta.GetKeywordValue("navigationType"); switch (type.Key.ToLower()) { case "localizable": res.NavType = NavigationType.Localizable; break; } string navTextFields = meta.GetSingleFieldValue("navigationTextFieldPaths"); if (!String.IsNullOrEmpty(navTextFields)) { res.NavTextFieldPaths = navTextFields.Split(',').Select(s => s.Trim()).ToList(); } res.ExternalUrlTemplate = meta.GetSingleFieldValue("externalLinkTemplate"); } return(res); }
private static NavigationConfig LoadConfig(Component component) { NavigationConfig res = new NavigationConfig {NavType = NavigationType.Simple}; if (component.Metadata != null) { ItemFields meta = new ItemFields(component.Metadata, component.MetadataSchema); Keyword type = meta.GetKeywordValue("navigationType"); switch (type.Key.ToLower()) { case "localizable": res.NavType = NavigationType.Localizable; break; } string navTextFields = meta.GetSingleFieldValue("navigationTextFieldPaths"); if (!String.IsNullOrEmpty(navTextFields)) { res.NavTextFieldPaths = navTextFields.Split(',').Select(s => s.Trim()).ToList(); } res.ExternalUrlTemplate = meta.GetSingleFieldValue("externalLinkTemplate"); } return res; }
private static NavigationConfig GetNavigationConfiguration(Component navConfigComponent) { NavigationConfig result = new NavigationConfig { NavType = NavigationType.Simple }; if (navConfigComponent.Metadata == null) { return result; } ItemFields navConfigComponentMetadataFields = new ItemFields(navConfigComponent.Metadata, navConfigComponent.MetadataSchema); Keyword type = navConfigComponentMetadataFields.GetKeywordValue("navigationType"); switch (type.Key.ToLower()) { case "localizable": result.NavType = NavigationType.Localizable; break; } string navTextFields = navConfigComponentMetadataFields.GetSingleFieldValue("navigationTextFieldPaths"); if (!string.IsNullOrEmpty(navTextFields)) { result.NavTextFieldPaths = navTextFields.Split(',').Select(s => s.Trim()).ToList(); } result.ExternalUrlTemplate = navConfigComponentMetadataFields.GetSingleFieldValue("externalLinkTemplate"); return result; }