Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Get page path or component path inside dialog field validator

danc13675873
Level 2
Level 2

How can I get the current page path e.g. /content/site/en/pageName or the current component path e.g. /content/site/en/pageName/jcr:content/component from within a dialog field validator (foundation.validation.validator)

registry.register("foundation.validation.validator", {

    selector: "[data-foundation-validation=someValidator]",

    validate: function(el) {

     // Some code to get page or component URL to make AJAX call

    }

});

1 Accepted Solution
Arun_Patidar
Correct answer by
Community Advisor
Community Advisor

Hi,

use below -

var page = Granite.author.pageInfoHelper.json.status.path

View solution in original post

2 Replies
Arun_Patidar
Correct answer by
Community Advisor
Community Advisor

Hi,

use below -

var page = Granite.author.pageInfoHelper.json.status.path

View solution in original post