First, I will apologize for my lack of knowledge on the subject. I was basically given a project to work on and told to get it to work. 2 days ago I had absolutely zero experience with PHP or CMSMS. I am doing my best but need some help here. I think it may just be something simple.
In our template we want to have the title of the page be displayed at the top of our content section. We were using the {title} tag for this. However, we needed the title to be in 2 colors. The first half of the title in one color, the second half in another. With the help of some code writers, I now have the following code which I have turned in to a User Defined Tag: {split_title}
Code: Select all
function multiColorHeading($input,$class1 = 'res-heading-black',$class2 = 'res-heading-golden') {
$temp = explode(' ',$input);
$half = count($temp) / 2;
$first = array_slice($temp,0,$half);
$second = array_slice($temp,$half);
return '<span class="'.$class1.'">'.implode(' ',$first).'</span> <span class="'.$class2.'">'.implode(' ',$second).'</span>';
}
$myTitle = 'Title Goes Here'; {
echo multiColorHeading($myTitle);
}
Code: Select all
$myTitle = $smarty->get_template_vars('title');