Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more

Is it possible to access CurrentPage ID from dojo widget

Vote:
 

Hi,

We have developed a custom key value property using dojo. We'd like to extend this widget with a dropdown list for value that is aware of it's context. In this case we'd like to populate the dropdown with a call to an external database by providing the currentpage ID as a parameter to a rest service. Is this possible?

#87472
Jun 13, 2014 13:42
Vote:
 

Do you mean the content link?
If true, you can get through context service (can be mixed-in with your widget by: _ContentContextMixin class):

For example:

define([

"dijit/_Widget",

"epi-cms/_ContentContextMixin"

], function(

_Widget,

_ContentContextMixin

) {

    return declare("Your widget name", [_Widget, _ContentContextMixin], {

        contextChanged: function (context, callerData) {
            this.inherited(arguments);

            // TODO: Your code when context change

            // Update dropdown data for instace!

        }

    });

});

Hope that help!

// Ha Bui

#87498
Jun 16, 2014 9:08
Vote:
 

Thank you Ha Bui!

Yes that was the soloution we were looking for.

/Andreas

#87499
Jun 16, 2014 9:22
Vote:
 

Is it possible to get a particular episerver property id on a page without using currentPage option. Is it possible to get the id by dojo framework ?

#142831
Edited, Jan 01, 2016 13:13
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.