hacks: inserting separator between news content

Moderator: mcsmom

Post Reply
User avatar
novata
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Thu Oct 20, 2005 2:50 pm

hacks: inserting separator between news content

Post by novata » Sun Feb 05, 2006 7:05 pm

Last edited by guilliam on Sun Feb 05, 2006 8:59 pm, edited 1 time in total.

FrankS
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Mon Oct 10, 2005 11:26 pm

Re: need a guide for this tutorial

Post by FrankS » Sun Feb 05, 2006 7:51 pm

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. ;)
Last edited by FrankS on Sun Feb 05, 2006 7:53 pm, edited 1 time in total.

User avatar
novata
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Thu Oct 20, 2005 2:50 pm

Re: hacks: inserting separator between news content

Post by novata » Sun Feb 05, 2006 10:05 pm

thanks this shorty tutorial!!
how does the finished menu look like?

/Novata

FrankS
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Mon Oct 10, 2005 11:26 pm

Re: hacks: inserting separator between news content

Post by FrankS » Sun Feb 05, 2006 10:12 pm

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, ...)

User avatar
novata
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Thu Oct 20, 2005 2:50 pm

Re: hacks: inserting separator between news content

Post by novata » Sun Feb 05, 2006 10:15 pm

ok.sorry!
I need to take a break!
:laugh:

FrankS
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Mon Oct 10, 2005 11:26 pm

Re: hacks: inserting separator between news content

Post by FrankS » Sun Feb 05, 2006 10:20 pm

Hehe, know that. :D

jmc
Joomla! Apprentice
Joomla! Apprentice
Posts: 26
Joined: Thu Aug 18, 2005 9:10 pm

Re: hacks: inserting separator between news content

Post by jmc » Sun Feb 05, 2006 11:59 pm

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

User avatar
novata
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Thu Oct 20, 2005 2:50 pm

Re: hacks: inserting separator between news content

Post by novata » Mon Feb 06, 2006 11:54 am

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?

User avatar
Joomlawebber
Joomla! Apprentice
Joomla! Apprentice
Posts: 14
Joined: Wed Aug 17, 2005 10:12 pm
Location: Denmark
Contact:

Re: hacks: inserting separator between news content

Post by Joomlawebber » Mon Feb 06, 2006 2:20 pm

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
If there is a bird flue, what happened to the egg flue?

Muller
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Thu Sep 22, 2005 3:26 pm

Re: hacks: inserting separator between news content

Post by Muller » Fri Mar 17, 2006 6:28 pm

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


Post Reply
';

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

echo '