Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


These support forums are now closed for new topics and comments.
Please head on over to http://eureka.ucommerce.net/ for support.

  • Tony Kiernan 278 posts 341 karma points
    Jun 24, 2011 @ 15:38
    Tony Kiernan
    0

    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)

  • Søren Spelling Lund 1797 posts 2786 karma points
    Jun 27, 2011 @ 09:09
    Søren Spelling Lund
    0

    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.

  • Tony Kiernan 278 posts 341 karma points
    Jun 27, 2011 @ 10:26
    Tony Kiernan
    0

    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?

  • Søren Spelling Lund 1797 posts 2786 karma points
    Jun 27, 2011 @ 14:31
    Søren Spelling Lund
    0

    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);
            }
        } 
  • Tony Kiernan 278 posts 341 karma points
    Jun 27, 2011 @ 14:53
    Tony Kiernan
    0

    >>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?

  • Søren Spelling Lund 1797 posts 2786 karma points
    Jun 27, 2011 @ 15:08
    Søren Spelling Lund
    0

    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.

  • Tony Kiernan 278 posts 341 karma points
    Jun 27, 2011 @ 17:52
    Tony Kiernan
    0

    Getting messy.  I'm going to go with your first suggestion.

    Next up: Razor and the marketing foundation :-)

Please Sign in or register to post replies

Write your reply to:

Draft