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
BedrockMission!

Learn More

View all

Sign in to view all badges

Get the Page Title in Component Dialog

Avatar

Avatar
Validate 1
Level 1
ashish_mishra1
Level 1

Like

1 like

Total Posts

19 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Ignite 1
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 1
ashish_mishra1
Level 1

Like

1 like

Total Posts

19 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Ignite 1
Boost 1
Affirm 1
View profile
ashish_mishra1
Level 1

05-02-2020

I have a requirement where I want to populate the page title in the component dialog as a value.  I know this can be done by writing dialog listener, Is there any other way to do this?

 

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,279 likes

Total Posts

3,155 posts

Correct Reply

889 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,279 likes

Total Posts

3,155 posts

Correct Reply

889 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile
Arun_Patidar
MVP

18-02-2020

You need to write a clientlib js, below code will work and return json response of page properties and you will get the jcr:title from responseText.

 

$.get(Granite.author.page.path+".1.json")

Answers (2)

Answers (2)

Avatar

Avatar
Give Back 50
MVP
Vijayalakshmi_S
MVP

Likes

446 likes

Total Posts

585 posts

Correct Reply

195 solutions
Top badges earned
Give Back 50
Give Back 5
Ignite 10
Ignite 5
Ignite 3
View profile

Avatar
Give Back 50
MVP
Vijayalakshmi_S
MVP

Likes

446 likes

Total Posts

585 posts

Correct Reply

195 solutions
Top badges earned
Give Back 50
Give Back 5
Ignite 10
Ignite 5
Ignite 3
View profile
Vijayalakshmi_S
MVP

06-02-2020

HI, 

My previous comment is with respect to Touch UI dialog.

Avatar

Avatar
Give Back 50
MVP
Vijayalakshmi_S
MVP

Likes

446 likes

Total Posts

585 posts

Correct Reply

195 solutions
Top badges earned
Give Back 50
Give Back 5
Ignite 10
Ignite 5
Ignite 3
View profile

Avatar
Give Back 50
MVP
Vijayalakshmi_S
MVP

Likes

446 likes

Total Posts

585 posts

Correct Reply

195 solutions
Top badges earned
Give Back 50
Give Back 5
Ignite 10
Ignite 5
Ignite 3
View profile
Vijayalakshmi_S
MVP

06-02-2020

HI, 

 

We can make use of dialog-ready event to manipulate dialog fields when we open a dialog.

However the use case of populating it with page title will not be possible as the same is not accessible in front end.  

Perhaps we can make use of window.location.pathname to get pagename alone by string manipulations. (If page name is framed automatically or if it is consistent across projects, you can arrive at way of making extracted page name as Page title,  again via String manipulations)

 

$(document).on("dialog-ready", function() {

       var pageTitle = ..

      $("input[name='./text']").val(pageTitle);  // name attribute of desired dialog field

});