In my practice, it has often happened to use two or more templates for the Cale's site. In Joomla 1.5, this is quite conveniently implemented, one template is chosen default (applied to all newly created menu items), and the second one is “selective”. Usually, the content itself is published in this case on the default template. This is all done quite simply and quickly, but there are also disadvantages. I wanted to tell about one of them in this post.
The fact is that when the module is published (search, news) on the main one, and if it is also “selective” here, i.e. the content is called in another template, an interesting thing happens. Each news item is assigned a Itemid corresponding menu in which the module is published, and for the main one it is “1”. Thus, Zhumla tries to open this URL under this Itemid, and since it does not contain a content call, the transition to the internal page does not occur, the news is not displayed, that is, everything remains unchanged. I am not familiar, closely, with the Jumlava IPA, but for me it became a very unpleasant surprise. The flexibility of the Jumbles in terms of the independence of the structure elements from the content elements was one of those factors that I took up with studying the engine. Moreover, this process began to manifest itself only after installing the Joomfish component. Nevertheless, it was necessary to find a way out. I found a way out perhaps not the most correct, but working. Long tormented by this Itemid = 1, I decided to get rid of it. In order not to cause conflicts I equated Itemid to “0” (The fact is that equating Itemid to other values ​​not equal to zero, I risked assigning it to an existing structure (menu) element, and the unit is the very first element, ie
"0" is absolutely free.) Below, I will give the changes made in the file mod_newsflash / helper.php
Original code:
$item->linkOn = JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catslug, $item->sectionid));
In this line, the URLA news is assembled (the ordinal number of the article id, the title of the article, the ordinal number of the catid category, as well as the ordinal number of the structure element (menu) Itemid).
')
All I did was “forcibly” assign the itemid “0” to all items. Thus, my news has ceased to belong to any menu.
Code:
$item->linkOn = JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catslug.'&Itemid=0', $item->sectionid));
After this change, all the news began to follow its internal links, that is, the default template was called.
A similar change was made to the search module, but this time it was necessary to edit the component.
Opening the components / com_search / controller.php file made changes in this line:
$this->setRedirect(JRoute::_('index.php'.$uri->toString(array('query', 'fragment')), false));
Replaced with:
$this->setRedirect(JRoute::_('index.php'.$uri->toString(array('query', 'fragment')).'&Itemid=0', false));
Again forcibly assigning Itemid = 0 to it
I missed a lot of details when writing a post, but I managed to convey the essence. Perhaps this method is not literate, but I achieved my goal, but for me this is the main thing.
Thank!