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

How get XF from a component?

btaymaz
Level 2
Level 2

How can I access XF properties from a component inside XF. "currentPage" returns main page.

 

Page > XF Component > XF > Custom Component

1 Accepted Solution
btaymaz
Correct answer by
Level 2
Level 2

I did this for now

 

private Page getXFPage(Resource res) {
    if(res.getResourceType().equals("cq:Page")) {
    	return res.adaptTo(Page.class);  		
    }     	
    return getXFPage(res.getParent());
}

View solution in original post

0 Replies
btaymaz
Correct answer by
Level 2
Level 2

I did this for now

 

private Page getXFPage(Resource res) {
    if(res.getResourceType().equals("cq:Page")) {
    	return res.adaptTo(Page.class);  		
    }     	
    return getXFPage(res.getParent());
}

View solution in original post