Close

Custom account page has a different look?

carsten
6 years ago
#14406 Quote
Avatar
  • 1
Hello,

I'm create a plugin that creates a project list, this page is added to the Account pages.
And for some reason it does not have the same look as the other pages.

This is how it look before i enter my page, in the bottom of the navigation i can se my link, with no icon (witch is okay).


when I click the link, I go my page (My Projects). Here I get a page that looks more or less like the original look of nop commerce.


I'm missing something completely obvius. But i cant figure out what.
I have tried looking at the info view from the theme, and this contains:

@{
    Layout = "_ColumnsTwo";

    //title
    Html.AddTitleParts(T("PageTitle.Account").Text);
    //page class
    Html.AppendPageCssClassParts("html-account-page");
    Html.AppendPageCssClassParts("html-customer-info-page");
}


And my page contains:

@{
    Layout = "_ColumnsTwo";

    //title
    Html.AddTitleParts(T("PageTitle.Account").Text);
    //page class
    Html.AppendPageCssClassParts("html-account-page");
    Html.AppendPageCssClassParts("html-projects-page");
}


I actually also tried to add the "html-customer-info-page" class, just to see if this changed anything, but it didn't.

please help ;-)
ZornitsaIvanova
6 years ago
#14407 Quote
Avatar
  • Moderator
  • 34
Can you please check if there is 'customer-pages-body' class at the body tag in your page?
Best regards,
Zornitsa Ivanova
Nop-Templates.com
JQuick
4 years ago
#21388 Quote
Avatar
  • 2
ZornitsaIvanova wrote:
Can you please check if there is 'customer-pages-body' class at the body tag in your page?



Hi There!. To the original poster. I'm not sure if you solved your issue those years ago, but I ran into the same product just yesterday.  My resolution was as follows:

1) Modify /Themes/<ThemeName>Views/Shared/_CurrentPageClass.cshtml - Add logic to check for your custom controller action so it returns the class customer-pages-body for the body tag



var isMyCustomPage = controllerName.Equals("mycustomcontroller", StringComparison.InvariantCultureIgnoreCase) && actionName.Equals("mycustomaction", StringComparison.InvariantCultureIgnoreCase);


if (isAccountPage || isOrderListPage || isReturnRequest || isBackInStockSubscriptions || isRewardPoints || isForumSubscriptions || isMyCustomPage)
    {
        <text>customer-pages-body</text>
        return;
    }



2) - Modify /Themes/<ThemeName>Views/Shared/_ColumnsTwo.cshtml - Add logic to check for your custom controller action and add it to the logic flow for 'isCustomerAccountPage'


   var isMyCustomPage = currentController.Equals("mycustomcontroller", StringComparison.InvariantCultureIgnoreCase) && currentAction.Equals("mycustomaction", StringComparison.InvariantCultureIgnoreCase);



    isCustomerAccountPage = isCustomerAccountPage || isOrderListPage || isReturnRequest || isBackInStockSubscriptions || isRewardPoints || isForumSubscriptions || isMyProductReviews || isVendorInfo || isHelpDeskPage || isMyCustomPage;

    if (isCustomerAccountPage ||
        currentController.Equals("order", StringComparison.InvariantCultureIgnoreCase) ||
        currentController.Equals("blog", StringComparison.InvariantCultureIgnoreCase) ||
        currentController.Equals("richblog", StringComparison.InvariantCultureIgnoreCase) ||
        currentController.Equals("richblogsearch", StringComparison.InvariantCultureIgnoreCase) ||
        (currentController.Equals("catalog", StringComparison.InvariantCultureIgnoreCase) &&
        currentAction.Equals("producttagsall", StringComparison.InvariantCultureIgnoreCase)))
    {
        isOneColumn = false;
    }


Cheers
Jon