简体   繁体   English

如何在登录页面上禁用面包屑

[英]How to disable Breadcrumbs on Login page

I want to hide Breadcrumbs component if I go to the Login page, I can just replace content with empty content:如果我 go 到登录页面,我想隐藏面包屑组件,我可以用空内容替换内容:

@NgModule({
  declarations: [
    AppLoginFormComponent,
    AppAuthTabsComponent,
  ],
  imports: [
    ConfigModule.withConfig({
      cmsComponents: {
        ReturningCustomerLoginComponent: {
          component: AppLoginFormComponent,
          disableSSR: true,
        },
        BreadcrumbComponent: {
          component: EmptyContentComponent,
          disableSSR: true,
        },
      }
    } as CmsConfig),
    CommonModule,
    FormsModule,
    I18nModule,
    UrlModule,
    RouterModule,
    ReactiveFormsModule,
    FormErrorsModule,
    SharedModule,
  ],
})
export class LoginPageModule { }

This approach partially helps, but this approach will also replace this component in whole system.这种方法部分有帮助,但这种方法也将在整个系统中替换这个组件。

So, what is the proper way to hide component on concrete page, or even how to add unique customization for it.那么,在具体页面上隐藏组件的正确方法是什么,甚至如何为其添加独特的自定义。

The proper way to choose which components are displayed on specified page should be done in sampledata/backoffice, not Spartacus side.选择在指定页面上显示哪些组件的正确方法应该在 sampledata/backoffice 中完成,而不是在 Spartacus 端。

Go to https://localhost:9002/hac/console/impex/import past next impex, and press Import Content button. Go 到https://localhost:9002/hac/console/impex/import过下一个 impex,然后按Import Content按钮。

$contentCatalog=apparel-uk-spaContentCatalog
$contentCV=catalogVersion(CatalogVersion.catalog(Catalog.id[default=$contentCatalog]),CatalogVersion.version[default=Online])[default=$contentCatalog:Online]
$siteResource=jar:de.hybris.platform.spartacussampledata.constants.SpartacussampledataConstants&/spartacussampledata/import/contentCatalogs/apparel-ukContentCatalog

# clear BottomHeaderSlot for home page (replaced by an empty slot)
INSERT_UPDATE ContentSlot;$contentCV[unique=true];uid[unique=true];name;cmsComponents(uid, $contentCV)
;;LoginBottomHeaderSlot;Homepage Bottom Header Slot;

INSERT_UPDATE ContentSlotForPage;$contentCV[unique=true];uid[unique=true];position[unique=true];page(uid,$contentCV);contentSlot(uid,$contentCV)[unique=true]
;;BottomHeaderSlot-login;BottomHeaderSlot;login;LoginBottomHeaderSlot

This impex will replace Breadcrumbs on Login page with empty content.这个 impex 将用空内容替换登录页面上的面包屑。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM