Hello People I am trying to create an alternate la...
# suitecommerce
a
Hello People I am trying to create an alternate layout for my facet-browse page. There are three categories for which I want to display that alternate layout. I was reading the documentation and it says that registerTemplate lets you change the layout for URL Path. When I do this for facet-browse and change the layout from SMT, it changes the layout for all category pages instead of those three. Why is that happening. Can someone highlight what am I missing?
s
When selecting the template in the SMTs you've not selected the right option
You either select an alternative layout for all pages of this type or this page specifically
a
Okay, Is the logic correct though? If I want to change the layout for three category pages and not PLP, I can do it by registering a template for facet-browse right?
s
Don't think so, you should do it through the SMTs
You could probably write some code to do what you want, but I wouldn't recommend it
eg some sort of beforeRender event listener that checks the route path and then changes the template name based on what it is
But if you want to do that, why bother registering the template in the first place?
... just write some code that modifies the view instance template pre-render