I customized the content module so the title of an article displays an image before the text and the text is displayed with two colors!!
The relevant part of the code is at follows:
<h2 class="title">
<?php if ($params->get('link_titles') && !empty($this->item->readmore_link)) : ?>
<a href="<?php echo $this->item->readmore_link; ?>">
<span class="image-title2"> </span>
<?php
$titles = explode(" ",$this->item->title);
for ($i=0; $i<count($titles)-1; $i++){
echo '<span style="float:left;padding-left:7px;color:#303030;">'.$this->escape($titles[$i]).'</span>';
}?>
<span style="color:#06cfef;float:left;padding-left:7px;"><?php echo $this->escape($titles[$i]);?></span></a>
<div class="clear"></div>
<?php else : ?>
<div><span class="image-title"></span>
<?php
$titles = explode(" ",$this->item->title);
for ($i=0; $i<count($titles)-1; $i++){
echo '<div style="float:left;padding-left:7px;">'.$this->escape($titles[$i]).'</div>';
}?>
<div style="color:#06cfef;float:left;padding-left:7px;"><?php echo $this->escape($titles[$i]);?></div></div>
<div style="clear:both;"></div>
<?php endif; ?>
In both IE and Google Chrome everything is displayed as wanted (apart from ie which has some positioning problem but i’m not focusing on that now)
In firefox, I can see the content loading correctly but just before the page finish loading the image disappears… I disabled javascript in FF and all is displayed correctly but I just can’t understand why!!
You can take a look at this url: http://sostudent.com/joomla/
Can anyone please help??
I’m pretty sure this is caused by gantry-buildspans.js .
Seems this script is needed to make the text of headings h1-h3 colored different. While doing this it replaces the contents of the headings with new span’s and the
span.image-title2will be discarded.As you don’t need this script, because you already do this on your own in the code above, you can remove this script.