How to get Current Page language from within a widget?

Posted by Community Admin on 05-Aug-2018 00:50

How to get Current Page language from within a widget?

All Replies

Posted by Community Admin on 23-Aug-2017 00:00

Hi, I have seen many similar questions here on the forum,  most of them about getting the current page Node which I have already tried with no success. Also this one:

knowledgebase.progress.com/.../How-to-programmatically-find-the-available-languages-on-the-current-page

I am working with feather,  I have created a custom widget, it has its own controller and view. I am not sure if I am doing it wrong to get the current page.

From the controller I have written what the above link suggests:

var actualSitemapNode = SiteMapBase.GetActualCurrentNode();
PageManager pageMgr = PageManager.GetManager();

 

GetActualCurrentNode() returns null every time, and seems that I need this to get the page ID and from there find the page languages available.

I have also tried with:
SiteMapBase.GetCurrentProvider() -> Object retrieved,  but in CurrentNode I get null.
SiteMapBase.GetCurrentNode() -> returns null

 

Any clue what I am missing? Any help is appreciated

 

This thread is closed