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
NilsN
January 8, 2020, 2:43pm
2
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:
Hi,
I got a website where i want to switch language and it redirects to same page on that language.
We got it setup that each language got a channel:
hostname/sv
hostname/en
So if I am on page: hostname/en/about-us i want to redirect to: hostname/sv/om-oss.
I have done this by using:
requestModel.CurrentPageModel.SystemId
PageService
ChannelService
UrlService
Though when a user is on a category or product page the SystemId above will not point to that “Page”.
I’m thinking i need to get…
When the headerViewModel is being build I want to detect if the startpage is loading. Any pointers on how to do that?
Litium version: 7
This worked great, thanks!
system
Closed
February 5, 2020, 2:55pm
4
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.