layout_header_footer
This commit is contained in:
81
template/layout_templates/footer.tpl
Normal file
81
template/layout_templates/footer.tpl
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
<? if (!@$_REQUEST["viewAMP"]){ ?>
|
||||||
|
{CODE}
|
||||||
|
<? }else{ ?>
|
||||||
|
<? $otros_contenidos = dame_registros("otros_contenidos", "visible_en_el_menu=1"); ?>
|
||||||
|
<footer id="footer">
|
||||||
|
<ul class="otros-contenidos">
|
||||||
|
<? foreach ($otros_contenidos as $otro):?>
|
||||||
|
<li><a href="<?=t($otro, 'enlace');?>" <? if (@$otro["no_indexar_en_google"]) {?>rel="nofollow"<?}?>><?=t($otro, "name");?></a></li>
|
||||||
|
<? endforeach;?>
|
||||||
|
</ul>
|
||||||
|
<?=t($configuracionRecord, "pie_de_pagina");?><br>Made with love by <a href="https://www.cocosolution.com" rel="noopener noreferer" target="_blank">Coco Solution</a>
|
||||||
|
</footer>
|
||||||
|
<? if (@$configuracionRecord["telefono"]) {?>
|
||||||
|
<a href="tel:<?=str_replace(" ", "", t($configuracionRecord, "telefono"));?>" id="amp-callCTA">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="phone_svg" x="0px" y="0px" width="512px" height="512px" viewBox="0 0 348.077 348.077" style="enable-background:new 0 0 348.077 348.077;" xml:space="preserve"><g><g><g><path d="M340.273,275.083l-53.755-53.761c-10.707-10.664-28.438-10.34-39.518,0.744l-27.082,27.076 c-1.711-0.943-3.482-1.928-5.344-2.973c-17.102-9.476-40.509-22.464-65.14-47.113c-24.704-24.701-37.704-48.144-47.209-65.257 c-1.003-1.813-1.964-3.561-2.913-5.221l18.176-18.149l8.936-8.947c11.097-11.1,11.403-28.826,0.721-39.521L73.39,8.194 C62.708-2.486,44.969-2.162,33.872,8.938l-15.15,15.237l0.414,0.411c-5.08,6.482-9.325,13.958-12.484,22.02 C3.74,54.28,1.927,61.603,1.098,68.941C-6,127.785,20.89,181.564,93.866,254.541c100.875,100.868,182.167,93.248,185.674,92.876 c7.638-0.913,14.958-2.738,22.397-5.627c7.992-3.122,15.463-7.361,21.941-12.43l0.331,0.294l15.348-15.029 C350.631,303.527,350.95,285.795,340.273,275.083z" fill="#FFFFFF"/></g></g></g></svg>
|
||||||
|
</a>
|
||||||
|
<? }?>
|
||||||
|
<? }
|
||||||
|
|
||||||
|
if (!@$_REQUEST["viewAMP"]){
|
||||||
|
?>
|
||||||
|
{BOTTOM_LIBRARIES}
|
||||||
|
<?
|
||||||
|
}
|
||||||
|
echo '<script>var MODULES_LOADED = '.json_encode(array_keys(Module::$loaded)).';</script>';
|
||||||
|
echo Module::links();
|
||||||
|
echo Module::scripts();
|
||||||
|
|
||||||
|
/*if (HAY_TIENDA && !@$_REQUEST["viewAMP"]) {
|
||||||
|
echo modulo("modal_livesearch");
|
||||||
|
?>
|
||||||
|
<script data-cache src="<?=h("/js/liveSearchModal.js");?>" async defer></script>
|
||||||
|
<script data-cache src="<?=h("/js/cesta_class.js");?>"></script>
|
||||||
|
<?
|
||||||
|
Resource::link('/css/cesta.css', true);
|
||||||
|
?>
|
||||||
|
<script>
|
||||||
|
var RUTA_RAIZ = '<?=RUTA_RAIZ;?>';
|
||||||
|
var ENLACE_CESTA = '<?=t(@$apartadoCesta, "enlace");?>';
|
||||||
|
var TEXTOS_CESTA = {
|
||||||
|
productoAnadido: '<?=t_var("Producto añadido");?>',
|
||||||
|
textoProductoAnadido: '<?=t_var("El producto ha sido añadido a la cesta");?>',
|
||||||
|
cancel: '<?=t_var("Continuar comprando");?>',
|
||||||
|
ok: '<?=t_var("Ir a la cesta");?>'
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<? if (@$configuracionTienda["pago_por_stripe"]) {?>
|
||||||
|
<script src="https://js.stripe.com/v3/"></script>
|
||||||
|
<? }
|
||||||
|
}*/
|
||||||
|
|
||||||
|
if (!@$_REQUEST["viewAMP"]){ ?>
|
||||||
|
<? if (!defined('USE_MIN_TAILWIND') || (defined('USE_MIN_TAILWIND') && !USE_MIN_TAILWIND)) { ?> {STYLE} <? } ?>
|
||||||
|
<? if (defined('USE_MIN_TAILWIND') && USE_MIN_TAILWIND == "2") {
|
||||||
|
generateMinCssV2();
|
||||||
|
?> <link rel="stylesheet" href="<?=h("/css/cocotail.min.css");?>" data-value="<?=USE_MIN_TAILWIND;?>">
|
||||||
|
<? } ?>
|
||||||
|
|
||||||
|
<? if (!defined('USE_MIN_JS_TAILWIND') || (defined('USE_MIN_JS_TAILWIND') && !USE_MIN_JS_TAILWIND)) { ?> {JAVASCRIPT} <? } ?>
|
||||||
|
<? if (defined('USE_MIN_JS_TAILWIND') && USE_MIN_JS_TAILWIND == "2") {
|
||||||
|
if (function_exists("generateMinJsV2")) generateMinJsV2();
|
||||||
|
?> <script src='<?=h("/js/cocotail.min.js");?>'></script>
|
||||||
|
<? } ?>
|
||||||
|
|
||||||
|
<?}
|
||||||
|
|
||||||
|
$dummyLib = []; addPlugins("tpl_foot",$dummyLib);
|
||||||
|
|
||||||
|
if (!@$_SESSION["pruebas"] && !@$_REQUEST["viewAMP"]){?><script defer data-cache src="<?=h("/js/cookies.js");?>"></script><?}
|
||||||
|
|
||||||
|
if (@$configuracionRecord["usar_service_worker"] && isHTTPS() && !@$_REQUEST["viewAMP"]) {
|
||||||
|
?><script data-cache src="<?=h('/js/sw-controller.js');?>"></script><?
|
||||||
|
}
|
||||||
|
if (hasRecaptcha() && !@$_REQUEST["viewAMP"] && property_exists('CocoParser', 'hayCaptcha') && @CocoParser::$hayCaptcha) {
|
||||||
|
?><script async defer data-cache src='https://www.google.com/recaptcha/api.js'></script><?
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
212
template/layout_templates/header.tpl
Normal file
212
template/layout_templates/header.tpl
Normal file
@@ -0,0 +1,212 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="<?=(@$_REQUEST["idioma"]) ? @$_REQUEST["idioma"] : "es";?>" <?=@$_REQUEST["viewAMP"] ? "⚡" : "";?> >
|
||||||
|
<head>
|
||||||
|
<?
|
||||||
|
if (@$_REQUEST["viewAMP"]){
|
||||||
|
?>
|
||||||
|
<script async src="https://cdn.ampproject.org/v0.js"></script>
|
||||||
|
{AMP_LIBRARIES}
|
||||||
|
<link rel="canonical" href="https://<?=$_SERVER["HTTP_HOST"].str_replace("/amp/","/",$_SERVER["REQUEST_URI"]);?>">
|
||||||
|
<?
|
||||||
|
}?>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||||
|
<meta name="description" content="<?=htmlentities($meta_descripcion);?>">
|
||||||
|
|
||||||
|
<?php
|
||||||
|
global $ocultar_metas_og, $tabla, $TABLE_PREFIX;
|
||||||
|
//Politicas no indexables
|
||||||
|
if($tabla == "cms_otros_contenidos"){
|
||||||
|
?><meta name="robots" content="noindex,nofollow"><?
|
||||||
|
}
|
||||||
|
$TEMPLATE = realpath(dirname(__FILE__)."/../../");
|
||||||
|
$logo = $TEMPLATE."/images/logo.png?t=1";
|
||||||
|
|
||||||
|
if (@$configuracionTienda["logo"]){
|
||||||
|
$logo = $configuracionTienda["logo"][0]['urlPath'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!@$ocultar_metas_og) {
|
||||||
|
echo '<meta property="og:title" content="'.@$titulo_de_pagina.'">';
|
||||||
|
echo '<meta property="og:description" content="'.htmlentities(@$meta_descripcion).'">';
|
||||||
|
|
||||||
|
if (!class_exists("CustomCode")) require_once __DIR__."/../../../../cms/lib/plugins/builder_saas/replace_code.php";
|
||||||
|
|
||||||
|
// ESTO HAY QUE MEJORARLO PORQUE SI LA IMAGEN ES DE IDIOMA MOSTRARA LA IMAGEN EN ESPAÑOL
|
||||||
|
|
||||||
|
// Buscamos en el campo 'meta_image' del registro
|
||||||
|
$imageExists = @mysql_fetch_assoc(mysql_query("SELECT urlPath FROM ".$TABLE_PREFIX."uploads WHERE tableName='".str_replace($TABLE_PREFIX,"",$tabla)."' and recordNum=".intval(@$_REQUEST["num"])." and urlPath not like '%.pdf%' and fieldName='meta_image' ORDER BY `order` ASC LIMIT 1"));
|
||||||
|
|
||||||
|
if (!@$imageExists) {
|
||||||
|
// Buscamos en el primer upload del registro
|
||||||
|
$imageExists = @mysql_fetch_assoc(mysql_query("SELECT urlPath FROM ".$TABLE_PREFIX."uploads WHERE tableName='".str_replace($TABLE_PREFIX,"",$tabla)."' and recordNum=".intval(@$_REQUEST["num"])." and urlPath not like '%.pdf%' ORDER BY `order` ASC LIMIT 1"));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!@$imageExists) {
|
||||||
|
// Buscamos en el campo 'meta_imagen' de configuración
|
||||||
|
$imageExists = @mysql_fetch_assoc(mysql_query("SELECT urlPath FROM ".$TABLE_PREFIX."uploads WHERE tableName='configuracion' and fieldName='meta_image' ORDER BY `order` ASC LIMIT 1"));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (@$imageExists) {
|
||||||
|
$image = CustomCode::imagec_inv($imageExists['urlPath'], 1200);
|
||||||
|
} else {
|
||||||
|
$image = CustomCode::imagec_inv($logo, 1200);
|
||||||
|
}
|
||||||
|
|
||||||
|
echo '<meta property="og:image" content="https://'.$_SERVER["HTTP_HOST"].$image.'">';
|
||||||
|
|
||||||
|
echo '<meta property="twitter:card" content="summary_large_image">';
|
||||||
|
echo '<meta property="twitter:site" content="https://'.$_SERVER["HTTP_HOST"].'">';
|
||||||
|
echo '<meta property="twitter:title" content="'.$titulo_de_pagina.'">';
|
||||||
|
echo '<meta property="twitter:description" content="'.htmlentities(@$meta_descripcion).'">';
|
||||||
|
echo '<meta property="twitter:image" content="https://'.$_SERVER["HTTP_HOST"].$image.'">';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
<meta name="keywords" content="<?=$meta_palabras;?>">
|
||||||
|
<meta name="author" content="<?=@$configuracionRecord["tienda_nombre_empresa"]?:'Coco Solution';?>">
|
||||||
|
|
||||||
|
<? if (@$configuracionRecord["pwa_theme_color"]) {?>
|
||||||
|
<meta name="theme-color" content="<?=$configuracionRecord["pwa_theme_color"];?>">
|
||||||
|
<? }?>
|
||||||
|
|
||||||
|
<? global $otros_metas,$modulosParaAMP,$redirectToAMP;?>
|
||||||
|
<?=@$otros_metas;?>
|
||||||
|
<title><?=$titulo_de_pagina;?></title>
|
||||||
|
<? if (@$redirectToAMP){?><link rel="amphtml" content="<?="/amp".$_SERVER["REQUEST_URI"];?>"><?}?>
|
||||||
|
|
||||||
|
<? if (@$configuracionRecord["usar_service_worker"]) {?>
|
||||||
|
<link rel="manifest" href="/manifest.json">
|
||||||
|
<? }?>
|
||||||
|
|
||||||
|
<? $dummy = []; addPlugins("tpl_head",$dummy);?>
|
||||||
|
|
||||||
|
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
|
||||||
|
<!--[if lt IE 9]>
|
||||||
|
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
|
||||||
|
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||||
|
<![endif]-->
|
||||||
|
<?
|
||||||
|
if (@$configuracionTienda["favicon"]){
|
||||||
|
foreach($configuracionTienda["favicon"] as $favicon){
|
||||||
|
if (strpos(strtolower($favicon["urlPath"]),".ico")){
|
||||||
|
?><link rel="shortcut icon" href="<?=$favicon["urlPath"];?>" type="image/x-icon" /><?
|
||||||
|
}else{
|
||||||
|
?><link rel="apple-touch-icon" <?=@$favicon["info1"] ? "sizes='".$favicon["info1"]."'" : "";?> href="<?=$favicon["urlPath"];?>" /><?
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
?>
|
||||||
|
<link rel="shortcut icon" href="<?=RUTA_PLANTILLA;?>/icons/favicon.ico" type="image/x-icon" />
|
||||||
|
<link rel="apple-touch-icon" href="<?=RUTA_PLANTILLA;?>/icons/apple-touch-icon.png" />
|
||||||
|
<link rel="apple-touch-icon" sizes="57x57" href="<?=RUTA_PLANTILLA;?>/icons/apple-touch-icon-57x57.png" />
|
||||||
|
<link rel="apple-touch-icon" sizes="72x72" href="<?=RUTA_PLANTILLA;?>/icons/apple-touch-icon-72x72.png" />
|
||||||
|
<link rel="apple-touch-icon" sizes="76x76" href="<?=RUTA_PLANTILLA;?>/icons/apple-touch-icon-76x76.png" />
|
||||||
|
<link rel="apple-touch-icon" sizes="114x114" href="<?=RUTA_PLANTILLA;?>/icons/apple-touch-icon-114x114.png" />
|
||||||
|
<link rel="apple-touch-icon" sizes="120x120" href="<?=RUTA_PLANTILLA;?>/icons/apple-touch-icon-120x120.png" />
|
||||||
|
<link rel="apple-touch-icon" sizes="144x144" href="<?=RUTA_PLANTILLA;?>/icons/apple-touch-icon-144x144.png" />
|
||||||
|
<link rel="apple-touch-icon" sizes="152x152" href="<?=RUTA_PLANTILLA;?>/icons/apple-touch-icon-152x152.png" />
|
||||||
|
<?
|
||||||
|
}
|
||||||
|
if (@$alternate) {
|
||||||
|
foreach ($alternate as $alt):
|
||||||
|
?>
|
||||||
|
<link rel="alternate" href="<?=protocol()."://".$_SERVER["HTTP_HOST"].base64_decode($alt["fieldValue"]);?>" hreflang="<?=$alt["prefix"];?>" />
|
||||||
|
<?
|
||||||
|
endforeach;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add self-referenced hreflang
|
||||||
|
if(false) { // Desactivado el 30/03/2026 porque no tenía sentido que se repita.
|
||||||
|
$current_lang = @$_REQUEST["idioma"] ?: "es";
|
||||||
|
$current_url = protocol()."://".$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"];
|
||||||
|
?>
|
||||||
|
<link rel="alternate" href="<?=$current_url;?>" hreflang="<?=$current_lang;?>" />
|
||||||
|
<?
|
||||||
|
}
|
||||||
|
if (!@$_REQUEST["viewAMP"]){
|
||||||
|
?>
|
||||||
|
{TOP_LIBRARIES}
|
||||||
|
<?
|
||||||
|
}
|
||||||
|
if (@$configuracionRecord["otros_scripts"] && !@$_REQUEST["viewAMP"]) {
|
||||||
|
echo base64_decode($configuracionRecord["otros_scripts"]);
|
||||||
|
}
|
||||||
|
$idioma = ["url" => RUTA_RAIZ];
|
||||||
|
$idiomas = ["es" => "Español","en" => "English","de" => "Deutsch","fr" => "Français","ru" => "Pусский","it" => "Italiano"];
|
||||||
|
$idioma_actual = ["corto" => @$_REQUEST["idioma"] ?: "es"];
|
||||||
|
$idioma_actual["largo"] = @$idiomas[$idioma_actual['corto']];
|
||||||
|
$session = @$_SESSION;
|
||||||
|
$get = @$_GET;
|
||||||
|
$GLOBALS["session"] = @$session;
|
||||||
|
$GLOBALS["get"] = $get;
|
||||||
|
global $thisrecord,$root,$request;
|
||||||
|
$thisrecord = @$GLOBALS["apartado"];
|
||||||
|
$root = $GLOBALS;
|
||||||
|
$request = @$_REQUEST;
|
||||||
|
if (!@$_REQUEST["viewAMP"]){
|
||||||
|
?>
|
||||||
|
<script>
|
||||||
|
var hooksToken = '<?=sha1(session_id().$_SERVER["HTTP_HOST"]);?>';
|
||||||
|
var language = '<?=@$_REQUEST['idioma']?:'www'?>';
|
||||||
|
{CMSAPI_JS}
|
||||||
|
</script>
|
||||||
|
<?
|
||||||
|
}else{
|
||||||
|
?>
|
||||||
|
<style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
|
||||||
|
|
||||||
|
<?
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</head>
|
||||||
|
<? if (empty($_REQUEST["enlace"]) || $_REQUEST["enlace"] == "/") $index = true;?>
|
||||||
|
<body class="<? if (@$index) {?>portada<?}?> antialiased">
|
||||||
|
<? if (!@$_REQUEST["viewAMP"]){?>
|
||||||
|
|
||||||
|
{CODE}
|
||||||
|
|
||||||
|
<? }else{ ?>
|
||||||
|
|
||||||
|
<?
|
||||||
|
$apartados = dame_registros("apartados", "visible_en_el_menu=1", "globalOrder ASC");
|
||||||
|
|
||||||
|
$logo_information = getimagesize($logo);
|
||||||
|
$logo_ratio = @$logo_information ? $logo_information[1] / $logo_information[0] : 1;
|
||||||
|
|
||||||
|
?>
|
||||||
|
<header class="amp-header">
|
||||||
|
<button on="tap:header-sidebar.toggle" tabindex="0" class="amp-header--hamburger" aria-label="<?=t_var('Mostrar menú');?>">
|
||||||
|
<span class="icon-bar"></span>
|
||||||
|
<span class="icon-bar"></span>
|
||||||
|
<span class="icon-bar"></span>
|
||||||
|
</button>
|
||||||
|
<a href="<?=RUTA_RAIZ;?>/" class="amp-header-logo">
|
||||||
|
<amp-img src="<?=$logo?>" width="<?=33 / $logo_ratio;?>" height="33" layout="fixed" alt="<?=t($configuracionRecord, 'tienda_nombre_empresa');?>"></amp-img>
|
||||||
|
</a>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<amp-sidebar id="header-sidebar" class="ampstart-sidebar px3 md-hide lg-hide" layout="nodisplay">
|
||||||
|
<div>
|
||||||
|
<button on="tap:header-sidebar.toggle" tabindex="0" class="amp-sidebar--close items-start" aria-label="<?=t_var('Cerrar menú');?>">✕</button>
|
||||||
|
</div>
|
||||||
|
<ul class="amp-sidebar">
|
||||||
|
<li class="amp-sidebar--logo">
|
||||||
|
<a href="<?=RUTA_RAIZ;?>/">
|
||||||
|
<amp-img src="<?=$logo?>" width="<?=33 / $logo_ratio;?>" height="33" layout="fixed" alt="<?=t($configuracionRecord, 'tienda_nombre_empresa');?>"></amp-img>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<? foreach ($apartados as $apartado):
|
||||||
|
$hijo = dame_registros("apartados", "parentNum=$apartado[num] AND visible_en_el_menu=1", "siblingOrder ASC", 1);
|
||||||
|
$hijo = @$hijo[0];
|
||||||
|
?>
|
||||||
|
<li class="amp-sidebar--item">
|
||||||
|
<a href="<?=@$hijo ? t($hijo, 'enlace') : t($apartado, "enlace");?>">
|
||||||
|
<?=str_repeat(" ", intval($apartado["depth"]));?><?=t($apartado, "name");?>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<? endforeach;?>
|
||||||
|
</ul>
|
||||||
|
</amp-sidebar>
|
||||||
|
<? }?>
|
||||||
Reference in New Issue
Block a user