I am trying to develop a custom module using Kentico best practices where possible. I have been following the article at https://docs.kentico.com/k10/custom-development/creating-custom-modules, however I have found little direction when it comes to the following:
1 - When dealing with a custom UniGrid, I have had no luck passing a parameter with the EditActionUrl. From my understanding, the first column declared in the Columns property should be the 0-indexed string format parameter, however my EditActionUrl of "~/CMSModules/VendorOrders/EditVendorOrder.aspx?VendorID={0}" always takes the '{0}' as a literal. The only way I have gotten this to work is to create a custom OnAction handler with a Response.Redirect() to the appropriate editor page, but this doesn't feel best practice to me. Here is my relevant source:
ASPX:
<cms:UniGrid ID="gridCurrentOrders" runat="server" OrderBy="Name"
Columns="VendorID,Name,ItemCount,TotalQuantity,TotalCost"
EditActionUrl="~/CMSModules/VendorOrders/EditVendorOrder.aspx?VendorID={0}">
<GridActions Width="50">
<ug:Action Name="edit" Caption="$General.Edit$" FontIconClass="icon-edit" FontIconStyle="allow" />
</GridActions>
<GridColumns>
<ug:Column source="Name" caption="Vendor" width="50"></ug:Column>
<ug:Column source="ItemCount" caption="Item Count" width="25"></ug:Column>
<ug:Column source="TotalQuantity" caption="Total Qty" width="25"></ug:Column>
<ug:Column source="TotalCost" caption="Item Cost" width="100%"></ug:Column>
</GridColumns>
</cms:UniGrid>
Code Behind:
protected void Page_Load(object sender, EventArgs e)
{
// Calculate which SKUs need to be reordered as follows:
// When [AvailableItems] + [Amount unshipped already on an open vendor order] is at or less than [ReorderAt], reorder [ReorderQuantity]
gridCurrentOrders.DataSource = SKUInfoProvider.GetSKUs()
.Source(sku => sku.Join<VendorInfo>("SKUVendorID", "VendorID"))
.Where("SKUAvailableItems <= SKUReorderAt")
.GroupBy("VendorID", "Name")
.Columns("VendorID, Name, count(SKUID) as ItemCount, sum(SKUReorderQuantity) as TotalQuantity, sum(SKUVendorCost * SKUReorderQuantity) as TotalCost")
.Result;
}
2 - When using the built-in templates for a Custom Module UI page, you can simply check the "Display Breadcrumbs" box, however for seemingly obvious reasons, this doesn't do anything when Type = "URL". Is there a standard way to wire up breadcrumbs on custom .aspx module pages?
TIA,
-Keith