Html,
in content title

Discussion and education for beginner / novice programmers interested in embarking on the development process to take advantage of the extensible nature of the Joomla! CMS.

Moderators: tjay, seadap, Rogue4ngel, matthewhayashida

Forum rules
Post Reply
User avatar
smithveg
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Thu Jun 29, 2006 7:27 am
Contact:

Html,
in content title

Post by smithveg » Sun Sep 16, 2007 8:30 am

Hi,

I have a product name, 'Flat Circular Knife & Core Cutter Blade'. in 'Knife category'
And i set it as content title.

If look very messy if i publish all the content in knife category as Blog.
Does anyone know how to add
in title tag?
or any others way for me to seperate the title tag into 2 lines.

Original post: http://forum.joomla.org/index.php?topic=212750.0

User avatar
smithveg
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Thu Jun 29, 2006 7:27 am
Contact:

Re: Html,
in content title

Post by smithveg » Tue Sep 18, 2007 10:20 am

Hi, Buddies,
I found some method to break the title into 2 lines if it's too long.
But this seems to hack the ../components/com_content/content.html.php file.

Open: ../components/com_content/content.html.php

Find: function Title( &$row, &$params, &$access ) {

Just below of it, you will see the code below:
title;?>


Remove those code and replace the following:
if(strlen($row->title) > 24) {
//echo '
there are '. count(explode(" ",$row->title)) . ' in this title';
$longtext = $row->title;
$shorttext = wordwrap($longtext, 30, "
", true);

$row->title = $shorttext;
echo $row->title . '';
}
else {
echo $row->title . '';
}
?>


** Save a copy of your file before any amendment.

The digit 24, is make sense tell the system those title has more than 24 length.
You can change the 30, to any digit you like. This use to tell when the title length reach char 30, the 31char on ward will put at second line.

User avatar
smithveg
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Thu Jun 29, 2006 7:27 am
Contact:

Re: Html, <br> in content title

Post by smithveg » Tue Mar 18, 2008 2:16 pm

Another solution would be set the TD height

from:
<td class="contentheading<?php echo $params->get( 'pageclass_sfx' ); ?>" width="100%">

to:
<td class="contentheading<?php echo $params->get( 'pageclass_sfx' ); ?>" width="100%" height="60px" valign="top">


Post Reply