OK, serious newbie question; I want to add various tabs from the admin area (best sellers, recent orders etc) to the defualt/home page of the uCommerce admin area. How do I find the default page id? (I think I've worked out adding the tabs to it)
Yes, that is the page I mean, however, I'm looking to add a few of the existing Tabs in the admin area to the default page. So my inderstanding is that I would add a bunch of entries to the uCommerce_AdminTab table. I don't know what I would enter in the AdminPageId field?
To get that working you have to add a new admin page to the uCommerce_AdminPage table, which corresponds to your new page (uCommerce looks for it by namespace convention). You can use the TabViewBuilder class to build the actual tabs of your custom page.
Once you've got your new page in place. You can add tabs to it in the way describe in the Extending Admin article.
Here's an example of what a page looks like in uCommerce (this one is for managing campaigns). Notice the use of TabViewBuilder in the InitializeTabViewMethod.
public partial class EditCampaign : UmbracoEnsuredPresentedSaveablePage<EditCampaignPresenter, IEditCampaignView, Campaign>,
IHasTabView,
IEditCampaignView
{
public Campaign Campaign
{
get;
set;
}
#region UmbracoEnsuredPresentedPage overrides
protected override IEditCampaignView ViewToInject
{
get { return this; }
}
public override void InitializeTabView(TabView tabView)
{
TabViewBuilder builder = new TabViewBuilder();
builder.BuildTabView(tabView, this, true, SaveButton_Clicked);
}
#endregion
protected void Page_Load(object sender, EventArgs e)
{
}
private void SaveButton_Clicked(object sender, ImageClickEventArgs e)
{
if (!Page.IsValid)
return;
var args = new EntityCommandEventArgs<Campaign>(Campaign);
OnSaving(args);
OnSave(args);
OnSaved(args);
RefreshTreeNode(Campaign.Name);
ShowSpeechBubble("CampaignSavedHeader", "CampaignSavedBody", args.Entity.Name);
}
}
You'll want to use the full name of your particular page.
For example the fullname for the EditCampaign page I posted earlier is ASP.umbraco_uCommerce_marketing_editcampaign_aspx, which is actually based on its location in the folder hierarchy of the site (don't ask - this is the way Microsoft did it :)).
So the particular page is located in /umbraco/ucommerce/marketing and is called editcampaign.aspx
Say you have page in /umbraco/mycustompages/mypage.aspx its full name would be ASP.umbraco_mycustompages_mypage_aspx
You still have to wire up the page to use TabViewBuilder as illustrated by the code above.
Where to find the admin area default page?
OK, serious newbie question; I want to add various tabs from the admin area (best sellers, recent orders etc) to the defualt/home page of the uCommerce admin area. How do I find the default page id? (I think I've worked out adding the tabs to it)
By the default page I guess you mean the one initially displayed when you click the uCommerce app icon?
If that's the case you actually add pages just like you would add dashboard pages in Umbraco.
There's a similar question, which might give you some insight.
Yes, that is the page I mean, however, I'm looking to add a few of the existing Tabs in the admin area to the default page. So my inderstanding is that I would add a bunch of entries to the uCommerce_AdminTab table. I don't know what I would enter in the AdminPageId field?
To get that working you have to add a new admin page to the uCommerce_AdminPage table, which corresponds to your new page (uCommerce looks for it by namespace convention). You can use the TabViewBuilder class to build the actual tabs of your custom page.
Once you've got your new page in place. You can add tabs to it in the way describe in the Extending Admin article.
Here's an example of what a page looks like in uCommerce (this one is for managing campaigns). Notice the use of TabViewBuilder in the InitializeTabViewMethod.
>>To get that working you have to add a new admin page to the uCommerce_AdminPage table
I think that's the bit I'm having the issue with. Will just inserting a new record with FullName "ASP.umbraco_uCommerce_default_aspx" work?
You'll want to use the full name of your particular page.
For example the fullname for the EditCampaign page I posted earlier is ASP.umbraco_uCommerce_marketing_editcampaign_aspx, which is actually based on its location in the folder hierarchy of the site (don't ask - this is the way Microsoft did it :)).
So the particular page is located in /umbraco/ucommerce/marketing and is called editcampaign.aspx
Say you have page in /umbraco/mycustompages/mypage.aspx its full name would be ASP.umbraco_mycustompages_mypage_aspx
You still have to wire up the page to use TabViewBuilder as illustrated by the code above.
Getting messy. I'm going to go with your first suggestion.
Next up: Razor and the marketing foundation :-)
is working on a reply...