Page 1 of 1

hacks: inserting separator between news content

Posted: Sun Feb 05, 2006 7:05 pm
by novata

Re: need a guide for this tutorial

Posted: Sun Feb 05, 2006 7:51 pm
by FrankS
Hi,

Just played a little bit and it works (more or less elegant) ;)

Open the file /components/com_content/content.php and insert the red bold lines.
The code snipped starts at beginning on line 896 with Joomla! 1.0.7.

// Leading story output
if ( $leading ) {
echo '';
echo '';
for ( $z = 0; $z < $leading; $z++ ) {
if ( $i >= $total ) {
// stops loop if total number of items is less than the number set to display as leading
break;
}
echo '
';
show( $rows[$i], $params, $gid, $access, $pop, $option, $ItemidCount );
echo '
';
$i++;
}
echo "
";

echo '';
echo '';
}

if ( $intro && ( $i < $total ) ) {
echo '';
echo '';
echo '';
// intro story output
for ( $z = 0; $z < $intro; $z++ ) {
if ( $i >= $total ) {
// stops loop if total number of items is less than the number set to display as intro + leading
break;
}

if ( !( $z % $columns ) || $columns == 1 ) {
echo '';
}

echo '';
echo '';
break;
}
echo "
";

echo '';

Just play a little bit also with the other possibility at the Mambo tutorial.

Make a backup of the file first. ;)

Re: hacks: inserting separator between news content

Posted: Sun Feb 05, 2006 10:05 pm
by novata
thanks this shorty tutorial!!
how does the finished menu look like?

/Novata

Re: hacks: inserting separator between news content

Posted: Sun Feb 05, 2006 10:12 pm
by FrankS
novata wrote:how does the finished menu look like?


Menue? Which menue?
The Mambohut tutorial is for no menue.
It makes separators (hr) between the news in content (frontpage, blog, ...)

Re: hacks: inserting separator between news content

Posted: Sun Feb 05, 2006 10:15 pm
by novata
ok.sorry!
I need to take a break!
:laugh:

Re: hacks: inserting separator between news content

Posted: Sun Feb 05, 2006 10:20 pm
by FrankS
Hehe, know that. :D

Re: hacks: inserting separator between news content

Posted: Sun Feb 05, 2006 11:59 pm
by jmc
There is actually no need to do this. The article referenced in your link was written in 2004. There is an existing Joomla css class for an article "seperator", and the code is already built into your pages. All you need to do is create the entry in your template_css.css file.
Like so:
.article_seperator {
display : block;
height : 15px;
background-image : url(../images/separator.gif);
background-repeat : repeat-y;
}
Example : http://www.hartlepoolcameraclub.co.uk
HTH,
John Mc

Re: hacks: inserting separator between news content

Posted: Mon Feb 06, 2006 11:54 am
by novata
I was thinking about this,I have not tested yet but maybe there is another way to do it without handcoding,just upload a mosimage.. is there any difference?

Re: hacks: inserting separator between news content

Posted: Mon Feb 06, 2006 2:20 pm
by Joomlawebber
novata wrote:I was thinking about this,I have not tested yet but maybe there is another way to do it without handcoding,just upload a mosimage.. is there any difference?


The difference mentioned above is that you are sure that when you upgrade to a newer version of joomla, you dont have to handcode it all over again.
This way its sure to stay the same way ;)

/K

Re: hacks: inserting separator between news content

Posted: Fri Mar 17, 2006 6:28 pm
by Muller
jmc wrote:There is actually no need to do this. The article referenced in your link was written in 2004. There is an existing Joomla css class for an article "seperator", and the code is already built into your pages. All you need to do is create the entry in your template_css.css file.
Like so:
.article_seperator {
display : block;
height : 15px;
background-image : url(../images/separator.gif);
background-repeat : repeat-y;
}
Example : http://www.hartlepoolcameraclub.co.uk
HTH,
John Mc


Hi,

surely I am doing something wrong, but I copied the code, uploaded the image to /images and it is not showing anything. Using Lunar Eclipse template.

Thank you for your help.

Muller

';

// outputs either intro or only a link
if ( $z < $intro ) {
show( $rows[$i], $params, $gid, $access, $pop, $option, $ItemidCount );
} else {
echo "
";

echo '