on 2019 Oct 10 7:41 PM
Hi All,
Recently I have configured a new store and smartedit is opening fine, but when I select any page, the loading endless animations is being presented, and the following messages are being displayed in browser console:
Missing SmartEdit attributes on body element of the storefront - SmartEdit will resume once the attributes are added
Do anyone has experienced this error? How do I can fix it?
Thank you, in advance,
Best Regards,
Rodrigo
I am no expert in Spartacus, but i managed to fix this issue in my project.
In my project, Smartedit was loading fine when the starting page for Smartedit was homepage. The problem started when we introduced forced login (requiresAuthentication flag on BaseSite), so the starting page changed to login page. That resulted in 'Missing SmartEdit attributes on body element of the storefront - SmartEdit will resume once the attributes are added'.
Smartedit requires each component, content slot and whole html body element to have specific smartedit classes assigned. It is done in two places:
Somehow, for homepage those decorators and processCmsPage method were invoked, but not for other pages.
Mine solution was to modify my project smart-edit-feature.module.ts file as follows:
import {SmartEditService} from "@spartacus/smartedit/core";
...
export class SmartEditFeatureModule {
constructor(private smartEditService: SmartEditService) {
this.smartEditService.processCmsPage();
}
}
providers: [
...smartEditDecorators,
provideConfig(<CmsConfig>{
...
}),
...
]
Here i had a problem with import - using 'import {smartEditDecorators} from "@spartacus/smartedit/core/decorators";' failed. I had to copy those decorators from source code into my project and use this import 'import {smartEditDecorators} from "./decorators";'.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I can only assume your storefront doesn't respect the SmartEdit contract.
Did you install the smarteditaddon that allows your storefront to respect that contract? Maybe you can have a look at the page Migrating Accelerator Storefront Versions to be Edited by SmartEdit
Cheers,
Abderzake
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What exactly is the solution for this problem?
It still appears on 2211 with Composable Storefront 6.0
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
25 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.