Joomla und die Itemid

Take a look at the Joomla URL structure:

Beispiel: index.php?option=com_content&view=section&layout=blog&id=3&Itemid=4

Joomla draws a distinction between various views. You can choose them by the different menu views.We have got blogviews(Section/Category) , with articles-teaser and readmore-links.You can set the count of these articles and choose how many of them are displayed as link only. The readmore- links at the blog views point to the right position in our navigation tree already, if we had create an article or category-link in the menu before. If we have a duplicate menu item with the same traget and diffrent itemids , we get a problem. In this case the joomla iternal router gets in trouble. He don’t know which itemid is the right one and he choose this one the link is positioned on.The result is that nothing happens, the menu doesn’t open.

Important: Joomla Bug.

Requirements:

Inside of the menue we found the link “Aktuell” twice. The link target is the same but we have different itemids. Both of them got two child elements ( The same-target) One of the “Aktuell” is unpuplished , but within its child elments not.

The router doesn’t recognize that the child elements not really there and behaved the same as if the links were published.

Blog Content Category – more articles – only as links

In this case the router doesn’t work correctly. The navigationtree keep on closing. To change this in beez is no prob.

Actual generated link :

<code>

<a class="blogsection" href="/<?php echo JRoute::_(’index.php?view=article&id=’.$link->slug); ?>">

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

</code>

takes us away of the menutree, because he choose the article id as reference.But we need the category.

The function getArticleRoute could help

<code>

$test=JRoute::_(ContentHelperRoute::getArticleRoute($link->id, $row->catslug, $row->sectionid));

?>

<li> <a class="blogsection" href="/<?php echo $test; ?>"> angies new Link

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

</code>

Result: The navigation tree is open at the right position.

A similar Prob we got in „Categorie List Layout“

Actual link:

<code>

<a href="/<?php echo $item->link; ?>">

<?php echo $this->escape($item->title); ?></a>

with getArticleRoute

<? $test=JRoute::_(ContentHelperRoute::getArticleRoute($item->id, $row->catslug, $row->sectionid));

?>

<br /><a href="/<?php echo $test; ?>">

Angies new Link

<?php echo $this->escape($item->title); ?></a>

?>

</code>

Section list default.php

Same Same :

Replace:

<code>

<a href="/<?php echo $category->link; ?>" class="category"><?php echo $category->title; ?></a>

</code>

with :

<code>

<?$test2=JRoute::_(ContentHelperRoute::getCategoryRoute($category->id,$category->slug));?>

<a href="/<?php echo $test2;?>" class="category">Angie 2<?php echo $category->title; ?></a>

</code>

Conclusion: Joomla rocks .-)