Get current page type (Litium 6)

Hi,

How can i get the current page type? I need to check if I’m on a category page or not (Category template).

Litium version: 6

The page type when you’re visiting a category (or a product) will be the StartPage, since they’re not actual pages in the CMS.

Depending on where you need to check you could inject PageRequestData, cast its Data property as ProductPageData and inspect that to make your evaluation.

Category, BaseProduct and Variant is also available for model binding into an action. The latter two will be null if it’s a category.

Yes I ended up using PageRequestData.Data. From there I could get what i needed. Thanks!

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