Has anybody ever had an issue with Custom Content ...
# suitecommerce
j
Has anybody ever had an issue with Custom Content Types in the CMS not showing up in the HTML produced by the SEO generator? My “SEO expert” (note the contemptuous use of quotes) is telling me that content in one of the Custom Content Types I’ve developed isn’t showing up when the page is crawled.
s
telling me that content in one of the Custom Content Types I’ve developed isn’t showing up when the page is crawled
I mean, this is testable. You can visit your site with JavaScript disabled to see what crawlers will see (edit: you should do this in a private browsing window because the page generator won't run if you're a recognised user)
g
If you prefix the url with view-source: and append ?seodebug=T&preview=235 it should show you if there is content in the main div
You might need to change the preview value to prevent caching
p
hey @Jacob D... that might be happening indeed. What i most normally see is that people write modern js, using async/await, let/const, and => functions... that gets combined to the extensions file. The extension file then becomes unparsable And so, the site gets rendered on the seo engine but without extensions 🙂
g
Yes if you are using es6 wrap it with an if statement !SC.isPageGenerator()
p
that won't necessarily work if the file becomes unparseable because of using es6
g
Yea I've not used async await and tried too avoid es6 but it worked for some code I wrote ages ago and wasn't aware of the issue
p
some of the errors - as far as i see, happen at parsing time, and the conditional you mention is a runtime condition. if the parser of the seo generator sees things like "..." in the code it doesn't know what to do with them and fails inmediately.
🧐 2
g
Ah I see yea I think mine were using arrow functions
j
I had tested it using the method he was using (https://search.google.com/test/rich-results) and by disabling javascript in the browser. Both methods did fail for all my custom content modules. They’re just basic content modules, so I don’t think I’m doing anything too fancy in the JS, but maybe I’ve got something in there the parser doesn’t understand. I guess I’ll have to experiment
I just hate having to admit that guy was right…
g
Doesn't doesn't sound good hopefully you find solution soon