Hi @divanshjohndigital There are multiple ways to achieve the use case mentioned by you based on the business requirement.
Requirement I : (based on the locale the header/footer has to a different layout)
fetch the url of the current page and get the locale
@ScriptVariable
private Page currentPage;
String pagePath = currentPage.getPath();
final String[] = pagePath.split(SLASH);
final String locale = pagePath.startsWith(PATH_CONTENT) ? String.format("%s%s%s", split[4], HYPHEN, split[5]) : StringUtils.EMPTY;Now based on the locale you can auotmatically decide which layout needs to be displayed.
Requirement II (displayed the layout based on the selection within the footer/header):

Reference you using the initial content is as follows:
https://experienceleague.adobe.com/docs/experience-manager-65/developing/platform/templates/page-templates-editable.html?lang=en#initial-content
Hope this helps!
Thanks