London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
AI OnAI Off
London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
I'm not sure that is possible. A block isn't created "under" a page. It is created in a ContentFolder, and after that it can be added to a page (in e.g. a content area). When a block is created there isn't a current page.
I need to set a block's property on the basis of a page property under which that block is being created.
So, to achieve this, I have overriden SetDefaultValues method in block type. And in this method I tried getting current page from IPageRouteHelper interface using below code.
http://www.jondjones.com/learn-episerver-cms/episerver-developers-guide/episerver-api-explained/episerver-7-how-do-i-get-the-currentpage-from-a-controller
But it always returns StartPage as the current Page.
How can we get the current Page in the bllock type?
Thanks.