extension joomla, template joomla,banner extension joomla,jomla slider,slider joomla

Fix template module override to include the css-class-suffix

You are probably using a 3rd party template which uses a module-override which is not parsing the module css-class-suffix properly. Templates by YOOtheme and some Artiseer templates seem to have this issue.

In case you want to hide modules with Frontend-User-Access and are wondering if this is a template issue, set your site-template to Joomla's default 'rhuk_milkyway' and check if modules are hidden.

What some templates do wrong is that they totally ignore the css-class-suffix as set in the module configuration (try it!). To make Frontend-User-Access hide modules, this must be fixed in your template.

The fixes underneath will basically add the suffix to the style, which allows fua to hide it, and giving frontend-developers control over style.

If you have this issue but can not work this out, please contact us. We will be happy to fix your template.

  • Artiseer
  •  

Artiseer

Different versions of Artiseer produce different types of module-overrides. So you need to check with which version of Artiseer the template is made, and do the alteration(s) for that version to make the template stop ignoring any extra css-class-suffix. We are really sorry we can not make this any easyer for you.

Templates made with:

  • Artiseer version 3. No alterations needed!
  • Artiseer version 2.5
  • Artiseer version 2.4
  • Artiseer version lower then 2.4

Find out which version the template is made with.

 

Artiseer version 2.5

 

file: /templates/template_name/html/modules.php

line 11

 

01.if (in_array($sfx, array('art-nostyle', 'art-block', 'art-article')))
02.$style = $sfx;
03.switch ($style) {
04.case 'art-block':
05.modChrome_artblock($module, $params, $attribs);
06.break;
07.case 'art-article':
08.modChrome_artarticle($module, $params, $attribs);
09.break;
10.case 'art-nostyle':
11.modChrome_artnostyle($module, $params, $attribs);
12.break;
13.}

 

replace with

 

01.//if (in_array($sfx, array('art-nostyle', 'art-block', 'art-article')))
02.// $style = $sfx;
03. 
04.//make artiseer consider more then one classname   
05.$styles = array('art-nostyle', 'art-block', 'art-article');
06.for($n = 0; $n < count($styles); $n++){             
07.$style_length = strlen($styles[$n]);
08.$style_temp = substr($styles[$n], 1, $style_length);           
09.if(strpos($sfx, $style_temp)){
10.$style = $style;
11.break;
12.}   
13.}
14. 
15.switch ($style) {
16.case 'art-block':
17.//modChrome_artblock($module, $params, $attribs);
18.modChrome_artblock($module, $params, $attribs, $sfx);
19.break;
20.case 'art-article':
21.//modChrome_artarticle($module, $params, $attribs);   
22.break;
23.case 'art-nostyle':
24.//modChrome_artnostyle($module, $params, $attribs);
25.modChrome_artnostyle($module, $params, $attribs, $sfx);
26.break;
27.}

 

 

AND

line 41

 

01.function modChrome_artnostyle($module, &$params, &$attribs)
02.{
03.if (!empty ($module->content)) : ?>
04.<div class="art-nostyle">
05.<?php if ($module->showtitle != 0) : ?>
06.<h3><?php echo $module->title; ?></h3>
07.<?php endif; ?>
08.<?php echo $module->content; ?>
09.</div>
10.<?php endif;
11.}
12. 
13.function modChrome_artblock($module, &$params, &$attribs)
14.{
15.if (!empty ($module->content))
16.echo artxBlock(($module->showtitle != 0) ? $module->title : '', $module->content);
17.}

 

replace with

 

01.function modChrome_artnostyle($module, &$params, &$attribs, $sfx)
02.{
03.if (!empty ($module->content)) :
04.echo '<div class="art-nostyle '.$sfx.'">';
05.if ($module->showtitle != 0) : ?>
06.<?php echo '<h3>'.$module->title.'</h3>'; ?>
07.<?php endif; ?>
08.<?php echo $module->content;
09.echo '</div>';
10.endif;
11.}
12. 
13.function modChrome_artblock($module, &$params, &$attribs, $sfx)
14.{
15.if (!empty ($module->content))
16.echo artxBlock(($module->showtitle != 0) ? $module->title : '', $module->content, $sfx);
17.}

 

AND

file: /templates/template_name/functions.php

line 134

 

1.function artxBlock($caption, $content)

 

replace with

 

1.//function artxBlock($caption, $content)
2.function artxBlock($caption, $content, $sfx)

 

AND

line 145

 

1.<div class="art-Block">

 

replace with

 

1.<?php echo '<div class="art-Block '.$sfx.'">'; ?>


 

 

Artiseer version 2.4

 

file: /templates/template_name/html/modules.php

(about line 17)
1.if (in_array($sfx, array_keys($styles)))
2.$style = $sfx;
3.call_user_func($styles[$style], $module, $params, $attribs);

replace by:

01.//if (in_array($sfx, array_keys($styles)))
02.//$style = $sfx;
03.//call_user_func($styles[$style], $module, $params, $attribs);
04.//make artiseer consider more then one classname   
05.for($n = 0; $n < count($styles); $n++){
06.$style = each($styles);
07.$style= $style['key'];       
08.$style_length = strlen($style);
09.$style_temp = substr($style, 1, $style_length);           
10.if(strpos($sfx, $style_temp)){           
11.call_user_func($styles[$style], $module, $params, $attribs);
12.break;
13.}   
14.}

 

AND

(about line 34)

1.function modChrome_artblock($module, &$params, &$attribs)
2.{
3.if (!empty ($module->content))     
4.echo artxBlock(($module->showtitle != 0) ? $module->title : '', $module->content);
5.}

 

replace by:

1.function modChrome_artblock($module, &$params, &$attribs)
2.{
3.if (!empty ($module->content))   
4.echo artxBlock(($module->showtitle != 0) ? $module->title : '', $module->content, $params->get('moduleclass_sfx'));
5.}

 

AND

(about line 25)

1.<div class="art-nostyle">

 

change to:

 

1.<?php echo '<div class="art-nostyle '.$sfx.'">'; ?>

 

AND

(about line 46)

1.echo artxVMenuBlock(($module->showtitle != 0) ? $module->title : '', $module->content);

 

change to:

 

1.echo artxVMenuBlock(($module->showtitle != 0) ? $module->title : '', $module->content, $params->get('moduleclass_sfx'));

 

AND

(about line 48)

1.echo artxBlock(($module->showtitle != 0) ? $module->title : '', $module->content);

 

change to:

 

1.echo artxBlock(($module->showtitle != 0) ? $module->title : '', $module->content, $params->get('moduleclass_sfx'));

 

AND

file: /templates/template_name/functions.php

find this code:

1.function artxBlock($caption, $content)

 

replace by:

1.function artxBlock($caption, $content, $sfx)

 

AND

(in the same file a few lines under that)

1.<div class="art-Block">

 

replace by:

1.<?php echo '<div class="art-Block '.$sfx.'">'; ?>

 

AND

file: /templates/template_name/html/mod_mainmenu/default.php

line 137:

 

1.} else if ($params->get('moduleclass_sfx') == 'art-vmenu') {

 

change to

 

1.//} else if ($params->get('moduleclass_sfx') == 'art-vmenu') {} else if (strpos($params->get('moduleclass_sfx'), 'rt-vmenu')) {

 

Artiseer version lower then 2.4

file: /templates/template_name/html/modules.php

find this line:

 

1.<div class="Block">

 

change to:

 

1.<?php echo '<div class="Block '.$sfx.'">'; ?>

 

That should make the hiding of modules work.

Find out which version of Artiseer a template has been made

  1. open file: /templates/template_name/html/modules.php
  2. search for this code around line 33:
    1.$classes = ' ' . $parts[1];

    if the code is in there the template seems to be made with version 3. No alterations are needed!
  3. search for this code around line 11:
    1.if (in_array($sfx, array('art-nostyle', 'art-block', 'art-article')))

    if the code is in there the template seems to be made with version 2.5. Alterations.
  4. search for this code around line 17:
    1.if (in_array($sfx, array_keys($styles)))

    if the code is in there the template seems to be made with version 2.4. Alterations.
  5. search for this code:
    1.<div class="Block">

    if the code is in there the template seems to be made with a version lower then 2.4.Alterations.