Module work problems in Joomla 1.5 using two or more templates and the Joomfish component

In my practice, it often happened to use two or more templates for Zhumla sites. In Joomla 1.5, this is quite conveniently implemented, one template is selected by default (applied to all newly created menu items), and the second is “selective.” Typically, the content itself is published on the default template in this case. This is all done quite simply and quickly, but there are also disadvantages. I wanted to talk about one of them in this post.

The fact is that when publishing a module (search, news) on the main one, and if it is “selective,” i.e. the contents are called in another template, an interesting thing happens. Each news item is assigned an itemid corresponding menu in which the module is published, and for the main it is "1". Thus, Zhumla is trying to open this URL under this Itemid, and since it does not contain a call to the content, there is no transition to the internal page, the news is not displayed, that is, everything remains unchanged. I am not familiar, closely, with the Zhumlavsky IPA, but for me it was a very unpleasant surprise. Zhumla’s flexibility in terms of independence of structural elements from content elements was one of the factors for which I took up the study of the engine. Moreover, this process began to appear only after installing the Joomfish component. Nevertheless, a solution had to be found. I found the solution, 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 by equating Itemid to other values ​​not equal to zero, I risked assigning it to an existing structural element (menu), and the unit is the very first element, that is,
"0" is absolutely free.) Below I will give the changes made to the file mod_newsflash / helper.php
Original code: In this line the URL news is “assembled” (article id number, article name, catid category number, as well as serial number of the element of the structure (menu) Itemid). All I did was forcefully assign "0" Itemid to all items. Thus, my news ceased to belong to any menu. Code: After this change, all the news began to click on their internal links, i.e. began to be called default template. The search module managed to make a similar change, only this time it was necessary to edit the component. Having opened the file components / com_search / controller.php made changes in this line:

$item->linkOn = JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catslug, $item->sectionid));







$item->linkOn = JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catslug.'&Itemid=0', $item->sectionid));







$this->setRedirect(JRoute::_('index.php'.$uri->toString(array('query', 'fragment')), false));


Replaced by: Again, forcibly assigning her Itemid = 0 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 own, and for me it is important. Thanks!

$this->setRedirect(JRoute::_('index.php'.$uri->toString(array('query', 'fragment')).'&Itemid=0', false));







Also popular now: