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:

http://www.dogcircuit.com/connect/index.php?option=com_content&view=article&id=70:ashtabula-kennel-club&catid=78:latest-news&Itemid=435

but it should look like this:

http://www.dogcircuit.com/connect/index.php?option=com_content&view=article&id=70:ashtabula-kennel-club&catid=78:latest-news

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) :  ?>
      <li>
            <a href="<?php echo $item->link; ?>">      <<<<<<<<<<<<<<<<<<<<<<<<<<
                  <?php echo $item->title; ?></a>
      </li>
<?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: http://www.dogcircuit.com/connect/

and the links are at the bottom. Thanks for any help. This has been driving me crazy.
LVL 4
elliottbenzleAsked:
Who is Participating?
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.

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

function remove_excess($string){

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

	echo $string_split[0];

}

foreach ($list as $item) :  ?>

      <li>

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

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

      </li>

<?php endforeach; ?>

Open in new window

0

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:
Thanks
0
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
Joomla

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.