Surely I need to render the view in there somewher...
# suitecommerce
j
Surely I need to render the view in there somewhere? I can’t imagine just adding that template reference does anything, but the documentation seems to say that’s all to be done…
p
Rendering with page types works slightly different to regular routers. It does call showContent (and thus render) automatically for you, and because of that, when you need to fetch something - which normally blocks rendering -, now you'd implement it in the view's "beforeShowContent" fn, and return a promise.
k
Seems obvious, but just in case, did you publish the page?
j
@PabloZ I’m not even using a custom page type, though. I’m just using a standard cms-landing-page. Or are you talking about my custom template’s view file?
p
Mmm i was just answering the "render" part of your question. It's ok that you don't need to write a call to render anywhere as far as i can tell
j
@kkennedydesign Yeah. It doesn’t even get that far, though. As soon as I hit save in the SMT editor, the sidebar collapses, the page kind of reloaded and the layout reverts to the default template
@PabloZ No problem. Thanks. I can’t imagine there’s not something I’m missing here or something that’s not broken.
p
Copy code
'fullwidth.tpl'
that template is yours right?
Is that template in your manifest?
j
yes
(I mean, that’s not the specific name of it for client privacy purposes, but the name in my manifest matches the name of the template)
And the template is definitely taking effect because I see it change after I select the layout in the SMT
I do see the error
TypeError: n.props.onChange is not a function
in the console afterwards, but I don’t know if that’s related. Debugging in the console in SMT is an adventure to say the least
k
If there is an error in the js file I can see it failing