Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.
SOLVED

How get XF from a component?

Avatar

Level 3

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

 

Page > XF Component > XF > Custom Component

1 Accepted Solution

Avatar

Correct answer by
Level 3

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

1 Reply

Avatar

Correct answer by
Level 3

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());
}