carljackson wrote:I'm corrently working on an admin plugin (I had it nearly complete in 3.20) and I'm looking at translating it to 3.30 but I've just come across a bit of a block.
The admin tab strip creation is different due to the kendo UI change. Actually looks like the dev on that is incomplete?
I can see how to get content into the admin screen but not creating a tab.
looks to me like the event message for this would be better holding a IList of a "AdminTabModel" rather than a single htmlstring
something like:
public class AdminTabModel{
public string TabTitle {get; set}
public MvcHtmlString TabContent {get; set;}
}
You could then loop that on the page twice, once in the top ul /li and then at the bottom of the tabs
If not can you point me in the direction you were heading for adding tabs.
Thanks
Please find how we use it in one of our commercial themes below:
public class AdminTabStripCreatedEventConsumer : IConsumer<AdminTabStripCreated>
{
public void HandleEvent(AdminTabStripCreated eventMessage)
{
if (eventMessage.TabStripName == "affiliate-edit")
{
//http://docs.kendoui.com/api/web/tabstrip#methods-append
eventMessage.BlocksToRender.Add(new MvcHtmlString("<script>" +
"$(document).ready(function() {" +
"$('#category-edit').data('kendoTabStrip').append(" +
"[{" +
"text: 'New tab title'," +
"content: '<b>text</b>'" +
"}]);" +
"});" +
"</script>"));
var actionName = "CategoryIconTabContent";
var controllerName = "ThemeHelperComputer";
var routeValues = new RouteValueDictionary()
{
{"Namespaces", "Nop.Plugin.ThemeHelper.Computer.Controllers"},
{"area", null},
{"categoryId", categoryId}
};
var urlHelper = new UrlHelper(eventMessage.Helper.ViewContext.RequestContext).Action(actionName, controllerName, routeValues);
eventMessage.BlocksToRender.Add(new MvcHtmlString("<script>" +
"$(document).ready(function() {" +
"$('#affiliate-edit').data('kendoTabStrip').append(" +
"[{" +
"text: 'New tab title'," +
"contentUrl: '" + urlHelper. + "'" +
"}]);" +
"});" +
"</script>"));
}
}
}