css for module title

Rate this topic: Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.1.00 out of 6 based on 1 vote(s)
GK User
Sat Aug 29, 2015 1:44 am
Reply with quote
Report this post
Hello,
I'd like to do something I have seen in a website. I don't know if it is possible but I think it is no so difficult.
I want the border-bottom with two colors, and to do that I've seen that I need the module title betwen <span> in order to create a css just for the text.
With firebug I can see this code in news2 template:
<div class="box ">
<h3 class="header">CATEGORÍAS</h3>

And in the other website the code is:
<div class="module-inner">
<h3 class="module-title "><span>CATEGORIAS</span></h3>

And then in css I can create a .box .header span {.........}

I'd like to do something like the image I send.

My question is, where or how can I place <span> for the module title???

Thanks
User avatar
Senior Boarder

GK User
Sat Aug 29, 2015 4:02 pm
Reply with quote
Report this post
Actually you can't (without editing template core files) but maybe using :before and :after pseudo classes might help
User avatar
Moderator

GK User
Sat Aug 29, 2015 10:56 pm
Reply with quote
Report this post
But which is the file I should edit?? module.php???
I think is in this code, but I don't know

if($module->showtitle) {
$title = str_replace('[br]', '<br />', preg_replace('/__(.*?)__/i', '<small>${1}</small>', $module->title));
$title = preg_replace('@\[icon\-([a-zA-Z0-9]*?)\]@mis', '<i class="gk-icon-$1"></i>', $title);

if($params->get('module_link_switch')) {
echo '<h'.$header_type.' class="header"><a href="'. $params->get('module_link') .'">'. $title .'</a></h'.$header_type.'>';
} else {
echo '<h'.$header_type.' class="header">'. $title .'</h'.$header_type.'>';
}
User avatar
Senior Boarder

GK User
Wed Sep 02, 2015 3:01 pm
Reply with quote
Report this post
file:
Code: Select all
/templates/gk_news2/html/modules.php

code:
Code: Select all
      if($module->showtitle) {   
         $title = str_replace('[br]', '<br />', preg_replace('/__(.*?)__/i', '<small>${1}</small>', $module->title));
         $title = preg_replace('@\[icon\-([a-zA-Z0-9]*?)\]@mis', '<i class="gk-icon-$1"></i>', $title);

         if($params->get('module_link_switch')) {
            echo '<h'.$header_type.' class="header"><a href="'. $params->get('module_link') .'">'. $title .'</a></h'.$header_type.'>';
         } else {
            echo '<h'.$header_type.' class="header">'. $title .'</h'.$header_type.'>';
         }
      }

needs to be changed to:
Code: Select all
      if($module->showtitle) {   
         $title = str_replace('[br]', '<br />', preg_replace('/__(.*?)__/i', '<small>${1}</small>', $module->title));
         $title = preg_replace('@\[icon\-([a-zA-Z0-9]*?)\]@mis', '<i class="gk-icon-$1"></i>', $title);

         if($params->get('module_link_switch')) {
            echo '<h'.$header_type.' class="header"><a href="'. $params->get('module_link') .'"><span>'. $title .'</span></a></h'.$header_type.'>';
         } else {
            echo '<h'.$header_type.' class="header"><span>'. $title .'</span></h'.$header_type.'>';
         }
      }
User avatar
Moderator

GK User
Wed Sep 02, 2015 4:19 pm
Reply with quote
Report this post
Thanks Ciberek¡¡

It was just what I have trued before post the question, but know I have noticed that I had to create a new title to view changes¡¡

Works perfectly¡
User avatar
Senior Boarder

GK User
Mon Sep 07, 2015 6:25 am
Reply with quote
Report this post
If you have any additional questions regarding this topic, please let me know.
User avatar
Moderator


cron