← Desenvolvimento

Alteração de titulo de módulos

Lida 1404 vezes

Offline

GhostMaster 
Membro
Mensagens 1374 Gostos 0
Feedback +10

Troféus totais: 26
Trófeus: (Ver todos)
Super Combination Combination Topic Starter Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1 1000 Posts

Boas queria alterar o titulo dos módulos numa página em joomla, o que eu queria fazer era alterar este código de modo a que o titulo fosse tratado apenas como uma parte e não como duas, um exemplo disso está nesta imagem:



Como podem ver a primeira parte está a negrito e a vermelho, a segunda a cinza e sem negrito, eu queria que fosse tudo a vermelho e negrito.

Fica aqui o código.


Código: [Seleccione]
function modChrome_gavickpro($module, &$params, &$attribs)
{
$headerLevel = isset($attribs['headerLevel']) ? (int) $attribs['headerLevel'] : 3;

if (!empty ($module->content)) : ?>
<div class="moduletable<?php echo $params->get('moduleclass_sfx'); ?>">
<?php if ($module->showtitle) : ?>

<?php
$title explode(' '$module->title);
$title_part1 array_shift($title);
$title_part2 join(' '$title);
?>


<h<?php echo $headerLevel?>><span><strong><?php echo $title_part1.' '?></strong><?php echo $title_part2?></span></h<?php echo $headerLevel?>>
<?php endif; ?>
    <div class="moduletable_content">
<?php echo $module->content?>
</div>
</div>
<?php endif;
}

/**

Version with interface
 
  Attributes:
  - headerLevel
  - interface:
  * 0 - without interface
  * 1 - modules roll up
  * 2 - modules order
  * 3 - modules roll up + order
 
**/

function modChrome_gavickpro_column($module, &$params, &$attribs)
{
$headerLevel = isset($attribs['headerLevel']) ? (int) $attribs['headerLevel'] : 3;
$interface = isset($attribs['interface']) ? (int) $attribs['interface'] : 3;

if (!empty ($module->content)) : ?>

<div class="moduletable<?php echo $params->get('moduleclass_sfx'); ?>" <?php echo ($module->showtitle) ? 'id="col_mod_'.$attribs['ordering'].'"' ''?>>
<?php if ($module->showtitle) : ?>

<?php
$title explode(' '$module->title);
$title_part1 array_shift($title);
$title_part2 join(' '$title);
?>


<h<?php echo $headerLevel?>>
<span><strong><?php echo $title_part1.' '?></strong><?php echo $title_part2?></span>
<?php if($interface 0) : ?>
<span class="interface">
<span class="down<?php if($interface == 1) echo '_disabled'?>"></span>
<span class="up<?php if($interface == 1) echo '_disabled'?>"></span>
<span class="rollup<?php if($interface == 2) echo '_disabled'?>"></span>
</span>
<?php endif; ?>
</h<?php echo $headerLevel?>>
<?php endif; ?>
  <div class="moduletable_content">
<?php echo $module->content?>
    </div>
</div>
<?php endif;
}

?>


Obrigado.
Offline

Eduardo Santos 
Equipa
Mensagens 1097 Gostos 1
Feedback +4

Troféus totais: 29
Trófeus: (Ver todos)
Tenth year Anniversary Super Combination Combination Topic Starter Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1

Deves precisar de mexer no CSS também.
Offline

GhostMaster 
Membro
Mensagens 1374 Gostos 0
Feedback +10

Troféus totais: 26
Trófeus: (Ver todos)
Super Combination Combination Topic Starter Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1 1000 Posts

Deves precisar de mexer no CSS também.

para alterar a cor não é? mas alterar a forma como o titulo é tratado achas que sim? eu andei a ver e no css não estava nada, apenas encontrei aqui referencia aos títulos dos módulos.
Offline

Diogo Pinto 
Administrador
Mensagens 4400 Gostos 371
Feedback +4

Troféus totais: 37
Trófeus: (Ver todos)
Avatar Search Level 6 Linux User Mobile User Super Combination Combination Topic Starter 50 Poll Votes 10 Poll Votes

Experimenta colocar no código onde diz:

Código: [Seleccione]
<span><strong><?php echo $title_part1.' '?></strong><?php echo $title_part2?></span>
O seguinte:

Código: [Seleccione]
<span><?php echo $title_part1.' '?><?php echo $title_part2?></span>
Offline

GhostMaster 
Membro
Mensagens 1374 Gostos 0
Feedback +10

Troféus totais: 26
Trófeus: (Ver todos)
Super Combination Combination Topic Starter Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1 1000 Posts

Experimenta colocar no código onde diz:

Código: [Seleccione]
<span><strong><?php echo $title_part1.' '?></strong><?php echo $title_part2?></span>
O seguinte:

Código: [Seleccione]
<span><?php echo $title_part1.' '?><?php echo $title_part2?></span>


Muito Obrigado Diogo Pinto, já andava aqui ás voltas e não conseguia fazer isto, não era bem o código que me deste, mas adicionei a tag <strong></strong> e está perfeito.

Muito obrigado a todos.

Cumprimentos.