Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Get page path or component path inside dialog field validator

Avatar

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

Avatar

Correct answer by
Community Advisor

Hi,

use below -

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



Arun Patidar

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

Hi,

use below -

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



Arun Patidar