- Postagens: 32
- Obrigados Recebidos: 0
Menu não aparece nos outros artigos
- gleiner57
-
Autor do Tópico
- Offline
- JCB! Colaborador
-
Menos
Mais
12 anos 1 mês atrás #93047
por gleiner57
gleiner57 created the topic: Menu não aparece nos outros artigos
Olá estou com o seguinte problema.
Tenho um menu php/html feito por lista não ordenada e estilizado por css.
Ele estava funcionando legal e aparecendo em todos os artigos, porém tive que fazer um if em php que trocava o menu de pt-br para en-gb. funcionou certinho o menu e respeita o módulo de troca de idioma clicando nas bandeirinhas
Porém agora o menu não aparece em nenhum dos artigos somente o index daí em ingles e português.
Aqui vai meu código:
Me ajudem! hehe!
Tenho um menu php/html feito por lista não ordenada e estilizado por css.
Ele estava funcionando legal e aparecendo em todos os artigos, porém tive que fazer um if em php que trocava o menu de pt-br para en-gb. funcionou certinho o menu e respeita o módulo de troca de idioma clicando nas bandeirinhas
Porém agora o menu não aparece em nenhum dos artigos somente o index daí em ingles e português.
Aqui vai meu código:
<?php
/**
* @package Joomla.Site
* @subpackage Templates.beez_20
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access.
defined('_JEXEC') or die;
jimport('joomla.filesystem.file');
// check modules
$showRightColumn = ($this->countModules('position-3') or $this->countModules('position-6') or $this->countModules('position-8'));
$showbottom = ($this->countModules('position-9') or $this->countModules('position-10') or $this->countModules('position-11'));
$showleft = ($this->countModules('position-4') or $this->countModules('position-7') or $this->countModules('position-5'));
if ($showRightColumn==0 and $showleft==0) {
$showno = 0;
}
JHtml::_('behavior.framework', true);
// get params
$color = $this->params->get('templatecolor');
$navposition = $this->params->get('navposition');
$app = JFactory::getApplication();
$doc = JFactory::getDocument();
$templateparams = $app->getTemplate(true)->params;
$doc->addStyleSheet($this->baseurl.'/templates/system/css/system.css');
$doc->addStyleSheet($this->baseurl.'/templates/'.$this->template.'/css/position.css', $type = 'text/css', $media = 'screen,projection');
$doc->addStyleSheet($this->baseurl.'/templates/'.$this->template.'/css/layout.css', $type = 'text/css', $media = 'screen,projection');
$doc->addStyleSheet($this->baseurl.'/templates/'.$this->template.'/css/print.css', $type = 'text/css', $media = 'print');
$files = JHtml::_('stylesheet', 'templates/'.$this->template.'/css/general.css', null, false, true);
if ($files):
if (!is_array($files)):
$files = array($files);
endif;
foreach($files as $file):
$doc->addStyleSheet($file);
endforeach;
endif;
$doc->addStyleSheet('templates/'.$this->template.'/css/'.htmlspecialchars($color).'.css');
if ($this->direction == 'rtl') {
$doc->addStyleSheet($this->baseurl.'/templates/'.$this->template.'/css/template_rtl.css');
if (file_exists(JPATH_SITE . '/templates/' . $this->template . '/css/' . $color . '_rtl.css')) {
$doc->addStyleSheet($this->baseurl.'/templates/'.$this->template.'/css/'.htmlspecialchars($color).'_rtl.css');
}
}
$doc->addScript($this->baseurl.'/templates/'.$this->template.'/javascript/md_stylechanger.js', 'text/javascript');
$doc->addScript($this->baseurl.'/templates/'.$this->template.'/javascript/hide.js', 'text/javascript');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>" >
<jdoc:include type="head" />
<!--[if lt IE 7 ]> <html class="ie6" xmlns="http://www.w3.org/1999/xhtml"> <![endif]-->
<!--[if IE 7 ]> <html class="ie7" xmlns="http://www.w3.org/1999/xhtml"> <![endif]-->
<!--[if IE 8 ]> <html class="ie8" xmlns="http://www.w3.org/1999/xhtml"> <![endif]-->
<!--[if IE 9 ]> <html class="ie9" xmlns="http://www.w3.org/1999/xhtml"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html xmlns="http://www.w3.org/1999/xhtml"> <!--<![endif]-->
<head>
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
</head>
<body>
<div id="all">
<div id="left">
<table width="1000" border="0">
<tr>
<td><p><a href="http://187.94.195.8:8088"><img border="0" src="/images/Logo_email_AMG.jpg" width="283" height="91"/></a></p></td>
<td><p><a target="_blank" href="http://www.amg-al.com"><img border="0" src="/images/logo_amg.jpg" align="left" width="91" height="60"/></a></p></td>
<td><p><img border="0" src="/images/tag.jpg" align="left" width="500" height="100%"/></p></td>
</tr>
<tr height="16px"><td></td></tr>
<tr>
<td colspan="3">
<p>
<?php
// Para conteúdos de idiomas diferentes
$app = JFactory::getApplication();
$menu = $app->getMenu();
if ($menu->getActive() == $menu->getDefault( 'en-GB' )) {
echo '  For aluminum grain refiners and master alloys, please visit the AMG Aluminum website at <a href="http://www.amg-al.com" target="_blank">www.amg-al.com</a><br>';
}
elseif ($menu->getActive() == $menu->getDefault( 'pt-BR' )) {
echo '  Para Ligas de Alumínio e Refinadores de grão, favor visitar o website da AMG Aluminum em <a href="http://www.amg-al.com" target="_blank">www.amg-al.com</a><br>';
}
?>
</p>
</td>
</tr>
</table>
</div>
<div id="right">
<jdoc:include type="modules" name="position-0"/>
</div>
<br>
<br>
<hr size="0,5px" width="978" noshade color="#F8F8FF">
<?php
// Menu troca idiomas
$app = JFactory::getApplication();
$menu = $app->getMenu();
if ($menu->getActive() == $menu->getDefault( 'en-GB' )) {
?>
<nav id="menu">
<ul>
<li class="current-menu-item"><a href="#">about us</a><!-- nível 1 -->
<ul>
<li class="current-menu-item"><a href="/index.php?option=com_content&view=article&id=11&Itemid=107">overview</a></li>
<li class="current-menu-item"><a href="/index.php?option=com_content&view=article&id=13&Itemid=107">history</a></li>
<li class="current-menu-item"><a href="/index.php?option=com_content&view=article&id=15&Itemid=107">locations</a>
<li class="current-menu-item"><a href="/index.php?option=com_content&view=article&id=16&Itemid=107">sustainability</a>
</ul>
</li>
<li class="current-menu-item"><a href="#">products</a><!-- nível 1 -->
<ul>
<li class="current-menu-item"><a href="/index.php?option=com_content&view=article&id=17&Itemid=107">aluminum</a></li>
<li class="current-menu-item"><a href="/index.php?option=com_content&view=article&id=18&Itemid=107">niobium</a></li>
<li class="current-menu-item"><a href="/index.php?option=com_content&view=article&id=19&Itemid=107">tantalum</a>
</ul>
</li>
<li class="current-menu-item"><a href="#">contact</a><!-- nível 1 -->
<ul>
<li class="current-menu-item"><a href="/index.php?option=com_content&view=article&id=20&Itemid=107">purchase & sales</a></li>
<li class="current-menu-item"><a href="/index.php?option=com_content&view=article&id=20&Itemid=107">form</a></li>
<li class="current-menu-item"><a target="_blank" href="https://www.vagas.com.br/lsm">careers</a></li>
</ul>
</li>
<li class="current-menu-item"><a href="#">restrict access</a>
<ul>
<li class="current-menu-item"><a href="https://email.amg-tantalum.com/owa">webmail</a></li>
<li class="current-menu-item"><a href="http://sharepoint.amg-tantalum.com/">sharepoint</a></li>
</ul>
</li>
</ul>
</nav>
<?php
}
elseif ($menu->getActive() == $menu->getDefault( 'pt-BR' ))
{
?>
<nav id="menu">
<ul>
<li class="current-menu-item"><a href="#">a empresa</a><!-- nível 1 -->
<ul>
<li class="current-menu-item"><a href="/index.php?option=com_content&view=article&id=3&Itemid=107">visão geral</a></li>
<li class="current-menu-item"><a href="/index.php?option=com_content&view=article&id=4&Itemid=107">história</a></li>
<li class="current-menu-item"><a href="/index.php?option=com_content&view=article&id=5&Itemid=107">localização</a>
<li class="current-menu-item"><a href="/index.php?option=com_content&view=article&id=6&Itemid=107">sustentabilidade</a>
</ul>
</li>
<li class="current-menu-item"><a href="#">produtos</a><!-- nível 1 -->
<ul>
<li class="current-menu-item"><a href="/index.php?option=com_content&view=article&id=7&Itemid=107">ligas alumínio</a></li>
<li class="current-menu-item"><a href="/index.php?option=com_content&view=article&id=8&Itemid=107">nióbio</a></li>
<li class="current-menu-item"><a href="/index.php?option=com_content&view=article&id=9&Itemid=107">tântalo</a>
</ul>
</li>
<li class="current-menu-item"><a href="#">contato</a><!-- nível 1 -->
<ul>
<li class="current-menu-item"><a href="/index.php?option=com_content&view=article&id=10&Itemid=107">compras & vendas</a></li>
<li class="current-menu-item"><a href="/index.php?option=com_content&view=article&id=11&Itemid=107">formulário</a></li>
<li class="current-menu-item"><a target="_blank" href="https://www.vagas.com.br/lsm">trabalhe conosco</a></li>
</ul>
</li>
<li class="current-menu-item"><a href="#">acesso restrito</a>
<ul>
<li class="current-menu-item"><a href="https://email.amg-tantalum.com/owa">webmail</a></li>
<li class="current-menu-item"><a href="http://sharepoint.amg-tantalum.com/">sharepoint</a></li>
</ul>
</li>
</ul>
</nav>
<?php
}
?>
<div id="SlideShow">
<jdoc:include type="modules" name="position-1" />
</div>
<div id="col580">
<div id="titulo">
</div>
<div id="main">
<jdoc:include type="message" />
<jdoc:include type="component" />
</div><!-- end main -->
</div><!-- end main -->
<div id="footer">
<span class="terms">
<span> <center>
<span class="terms"><a href="terms.html">Terms & Conditions
</a> l <a href="privacy.html">Privacy Policy</a> l <a href="siteMap.html">Site Map</a></span>
<center>
<p class="last"> <a href="http://www.lsmbrasil.com.br">©2013 LSM Brasil S.A. All Rights Reserved.</a></p>
</div>
</div>
</body>
</html>
Me ajudem! hehe!
Please Entrar ou Registrar to join the conversation.
- gleiner57
-
Autor do Tópico
- Offline
- JCB! Colaborador
-
Menos
Mais
- Postagens: 32
- Obrigados Recebidos: 0
- gleiner57
-
Autor do Tópico
- Offline
- JCB! Colaborador
-
Menos
Mais
- Postagens: 32
- Obrigados Recebidos: 0
12 anos 1 mês atrás #93348
por gleiner57
gleiner57 replied the topic: Re: Menu não aparece nos outros artigos
Aí galera, resolvi o meu problema.
Descobri a variável que o joomla salva na linguagem e adicionei ao meu código php.
Em questão apaguei a variável $app e as outras, e inseri $lang.
Daí já voltou a funcionar.
Descobri a variável que o joomla salva na linguagem e adicionei ao meu código php.
Em questão apaguei a variável $app e as outras, e inseri $lang.
Daí já voltou a funcionar.
Please Entrar ou Registrar to join the conversation.