You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I made the following change in order to be able to hide the "All categories" that is usually initially selected if using the treeview option. It can get enabled by adding ShowCats="false" to the dnn:DnnTreeView node in the ASCX file. I have not tested the change for any other display type than TreeView. Once ShowCats is set to false, it will, in view mode, hide the "All categories" option and instead select the first category. In page edit mode, it will still display it.
Maybe someone wants to add it to the repo. (Am too lazy atm).
In FAQs.ascx.cs Page_Load I added this to the bottom of the IsPostBack if statement: if (!IsPostBack) { ...Other stuff... if (!IsEditable) { if (treeCategories.Attributes["ShowAllCats"] != null) { if (treeCategories.Attributes["ShowAllCats"].Equals("false", StringComparison.OrdinalIgnoreCase)) { // Unselect "All Categories", select first cat node and hide "All Categories" treeCategories.Nodes[0].Selected = false; treeCategories.Nodes[1].Selected = true; treeCategories.Nodes[0].Visible = false; // Bind it again BindData(); } } } }
Initially I tried to simply comment out adding "All categories" in the BindCategories() method, but that did lead to some problems as the module expects that initially all questions are shown at least once to render the corresponding javascript correctly. If removing "All categories" at that point, only the questions of the first category would work, so I opted for this quick and dirty way.
Maybe someone else, would like the same change. I hope it helps.
Andy
The text was updated successfully, but these errors were encountered:
I made the following change in order to be able to hide the "All categories" that is usually initially selected if using the treeview option. It can get enabled by adding ShowCats="false" to the dnn:DnnTreeView node in the ASCX file. I have not tested the change for any other display type than TreeView. Once ShowCats is set to false, it will, in view mode, hide the "All categories" option and instead select the first category. In page edit mode, it will still display it.
Maybe someone wants to add it to the repo. (Am too lazy atm).
In FAQs.ascx.cs Page_Load I added this to the bottom of the IsPostBack if statement:
if (!IsPostBack) { ...Other stuff... if (!IsEditable) { if (treeCategories.Attributes["ShowAllCats"] != null) { if (treeCategories.Attributes["ShowAllCats"].Equals("false", StringComparison.OrdinalIgnoreCase)) { // Unselect "All Categories", select first cat node and hide "All Categories" treeCategories.Nodes[0].Selected = false; treeCategories.Nodes[1].Selected = true; treeCategories.Nodes[0].Visible = false; // Bind it again BindData(); } } } }
Initially I tried to simply comment out adding "All categories" in the BindCategories() method, but that did lead to some problems as the module expects that initially all questions are shown at least once to render the corresponding javascript correctly. If removing "All categories" at that point, only the questions of the first category would work, so I opted for this quick and dirty way.
Maybe someone else, would like the same change. I hope it helps.
Andy
The text was updated successfully, but these errors were encountered: