Hello Team,
I have created a custom language selector component which has resource super type
as core/wcm/components/languagenavigation/v1/languagenavigation
I have authored these
Navigation root: /content/abc/xyz/
Language Structure Depth: 2
Under the path /content/abc/xyz/ I have
/content/abc/xyz/US/en
/content/abc/xyz/US/fr
/content/abc/xyz/FR/fr
/content/abc/xyz/FR/en
By using out of the box feature, I will get the Country details and its language details.
Now, my current page is: /content/abc/xyz/FR/en/home/support
This page has my custom language selector component. I am able to see list of Country and its language details in my component.
Also, if I click on those languages, that will point to support.html with the country, language details
For above scenario, I have to create just a proxy component which has sling resource super type as: core/wcm/components/languagenavigation/v1/languagenavigation
Out of the box class name: com.adobe.cq.wcm.core.components.internal.models.v1.LanguageNavigationImpl
Now, based on some condition(say page property of support page has the property "isSpecialPage"
If this is selected, then I need to display different name for Country, languages. Consider Navigation Title. For this one, I have crated a custom method in my sling model.
import com.adobe.cq.wcm.core.components.models.LanguageNavigation;
@Self
@Via(type = ResourceSuperType.class)
@Delegate
private LanguageNavigation langNavigation;
public List<MyCustomLanguageNavigationItem> getCustomItems() {
List<NavigationItem> items = langNavigation.getItems();
List<MyCustomLanguageNavigationItem> customItems = Fetch the details from items
Read the country, language names from the path (which is present in items object)
But, for my surprise, NavigationItem object has details about Country Name, children (i.e each languge details) along with the current page URL. No, where I am able to get the country, language url details.
Can someone help me with this?