Getting startpage as CurrentPageModel on product page

I’m using the requestModelAccessor.RequestModel.CurrentPageModel to see which the current page is.
But when i’m on the product or category page it says i am on the StartPage.

How can i see if the current page is the product or category page?

Litium version: 7.3.1

Since categories and products don’t have their own pages in the CMS, current page will always be the start page for those.

You can inject the RouteRequestInfoAccessor and cast its .RouteRequestInfo.Data as ProductPageData to determine where you are.

Here are some older threads asking something similar:

This worked great, thanks!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.