big refactoring of mobile version xhich has now a hamburger menu and a link to collection
This commit is contained in:
@@ -116,7 +116,7 @@ function edlp_mobile_page_attachments(array &$attachments) {
|
||||
// we assume that there is only two alias by env (mobile or desktop)
|
||||
foreach ($env_aliases as $env_alias_id => $env_alias) {
|
||||
if($env_alias_id != $alias->id()){
|
||||
// we found the desktop pattern
|
||||
// we found the mobile pattern
|
||||
$mobile_url = $env_alias->getPattern();
|
||||
break;
|
||||
}
|
||||
@@ -128,6 +128,13 @@ function edlp_mobile_page_attachments(array &$attachments) {
|
||||
$is_front = \Drupal::service('path.matcher')->isFrontPage();
|
||||
$current_language = \Drupal::languageManager()->getCurrentLanguage()->getId();
|
||||
|
||||
// $config->set($domain_id . '.site_frontpage', $site_frontpage);
|
||||
|
||||
// $mobile_home_path = "???";
|
||||
$mobile_home_path = \Drupal::config('domain_site_settings.domainconfigsettings')->get('m_encyclopediedelaparole_org.site_frontpage', FALSE);
|
||||
// $desktop_home_path = "???";
|
||||
$desktop_home_path = \Drupal::config('domain_site_settings.domainconfigsettings')->get('encyclopediedelaparole_org.site_frontpage', FALSE);
|
||||
|
||||
// $redirect = false;
|
||||
$js_str = "var edlp_mobile = {\n
|
||||
current_url:'".$base_root."',\n
|
||||
@@ -136,7 +143,9 @@ function edlp_mobile_page_attachments(array &$attachments) {
|
||||
lang_code:'".$current_language."',\n
|
||||
is_mobile_domain:".($is_mobile_domain ? 'true':'false').",\n
|
||||
mobile_url:'".$mobile_url."',\n
|
||||
mobile_home_path:'".$mobile_home_path."',\n
|
||||
desktop_url:'".$desktop_url."',\n
|
||||
desktop_home_path:'".$desktop_home_path."',\n
|
||||
};";
|
||||
|
||||
$attachments['#attached']['html_head'][] = [
|
||||
|
||||
Reference in New Issue
Block a user