strange link behavior in Joomla 1.6

I'm using Joomla 1.6 and I have a scrolling news banner that is supposed to link to the article that it is showing.

Sometimes the link will go to the correct place, but sometimes it will put a '&Itemid=435' at the end and this screws up the link. Right now the link looks like this:

but it should look like this:

The second link takes me to the correct place. In the source code the link is being called like this:

<?php foreach ($list as $item) :  ?>
            <a href="<?php echo $item->link; ?>">      <<<<<<<<<<<<<<<<<<<<<<<<<<
                  <?php echo $item->title; ?></a>
<?php endforeach; ?>

The ItemId 435 corresponds to the plugin 'Content - Joomla'
435 also appears to correspond to the 'home' menu item

I'm not sure why it is being added to the end of these links.

You can see the page here:

and the links are at the bottom. Thanks for any help. This has been driving me crazy.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Not sue why it is doing that... however if you change the code to this it will remove the excess from the url.

function remove_excess($string){

	$string_split = split("&Itemid", $string);

	echo $string_split[0];


foreach ($list as $item) :  ?>


            <a href="<?php echo remove_excess($item->link); ?>"> 

                  <?php echo $item->title; ?></a>


<?php endforeach; ?>

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
elliottbenzleAuthor Commented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.