{"id":565,"date":"2010-11-18T17:51:36","date_gmt":"2010-11-18T15:51:36","guid":{"rendered":"http:\/\/www.kavdesign.net\/blog\/?p=565"},"modified":"2010-11-18T17:55:34","modified_gmt":"2010-11-18T15:55:34","slug":"fix-for-a-problem-with-joomla-k2-and-sh404sef","status":"publish","type":"post","link":"https:\/\/www.kavdesign.net\/blog\/coding\/fix-for-a-problem-with-joomla-k2-and-sh404sef\/","title":{"rendered":"Fix for a problem with Joomla K2 and sh404sef"},"content":{"rendered":"<p>First some explanation about the problem.<\/p>\n<p>The situation is when you have a Joomla 1.5 site with sh404sef 2.1.4 component and you want to add additional section for a blog for example and you want to use K2 2.4 for this.<\/p>\n<p>So in this case you have additional menu item called for example &#8216;blog&#8217; where you see a blog of your K2 articles. But you also want to have the tags and the search.<\/p>\n<p>The problem is that when you hit on a tag you go to the page with the tags but you don&#8217;t see the other modules for the &#8216;blog&#8217; item (you are redirected to a page without Itemid).<\/p>\n<p>The same is with the search results page.<\/p>\n<p>And one additional fix for a prefix in the url for your K2 blog.<\/p>\n<p><!--more-->To fix this issues:<\/p>\n<p><strong>1. Go to modules\/mod_k2_tools\/tmpl\/search.php<\/strong><\/p>\n<p>and add this line in front inside of some php:<\/p>\n<p>$Itemid = JRequest::getInt( &#8216;Itemid&#8217;);<\/p>\n<p>then on line 16 change this:<\/p>\n<p>&lt;form action=&#8221;&lt;?php echo JRoute::_(&#8216;index.php?option=com_k2&amp;view=itemlist&amp;task=search&#8217;); ?&gt;&#8221; method=&#8221;get&#8221;&gt;<\/p>\n<p>to:<\/p>\n<p>&lt;form action=&#8221;&lt;?php echo JRoute::_(&#8216;index.php?option=com_k2&amp;view=itemlist&amp;task=search&amp;Itemid=&#8217;.$Itemid); ?&gt;&#8221; method=&#8221;get&#8221;&gt;<\/p>\n<p><strong>2. Go to components\/com_k2\/helpers\/route.php<\/strong><\/p>\n<p>on line 111 you see this:<\/p>\n<pre>$link = 'index.php?option=com_k2&amp;view=itemlist&amp;task=tag&amp;tag='.urlencode($tag);\r\n\r\n if ($item = K2HelperRoute::_findItem($needles)) {\r\n $link .= '&amp;Itemid='.$item-&gt;id;\r\n }\r\n ;\r\n<\/pre>\n<p>change it to this:<\/p>\n<pre>$link = 'index.php?option=com_k2&amp;view=itemlist&amp;task=tag&amp;tag='.urlencode($tag);\r\n\r\n$Itemid = JRequest::getInt( 'Itemid');\r\n\r\n$link .= '&amp;Itemid='.$Itemid;\r\n<\/pre>\n<p><strong>3. To put a prefix in the URL for your blog go to components\/com_k2\/sef_ext\/com_k2.php<\/strong><\/p>\n<p>In lines 97 and 127 there should be a starting case statements:<\/p>\n<pre>case 'item':<\/pre>\n<pre>case 'itemlist':<\/pre>\n<p>After each one of those add this:<\/p>\n<pre>$title[] = 'blog';\r\n<\/pre>\n<p>You clould replace the word blog with that you think should be your word.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>First some explanation about the problem. The situation is when you have a Joomla 1.5 site with sh404sef 2.1.4 component and you want to add<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/www.kavdesign.net\/blog\/coding\/fix-for-a-problem-with-joomla-k2-and-sh404sef\/\">Continue reading<span class=\"screen-reader-text\">Fix for a problem with Joomla K2 and sh404sef<\/span><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_links_to":"","_links_to_target":""},"categories":[9,29],"tags":[137,417,98,140,38,139,36,141,138,103,130],"class_list":["post-565","post","type-post","status-publish","format-standard","hentry","category-coding","category-joomla","tag-fix","tag-joomla","tag-k2","tag-page","tag-problem","tag-result","tag-search","tag-sef-url","tag-sh404sef","tag-tags","tag-url","entry"],"_links":{"self":[{"href":"https:\/\/www.kavdesign.net\/blog\/wp-json\/wp\/v2\/posts\/565","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kavdesign.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kavdesign.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kavdesign.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kavdesign.net\/blog\/wp-json\/wp\/v2\/comments?post=565"}],"version-history":[{"count":6,"href":"https:\/\/www.kavdesign.net\/blog\/wp-json\/wp\/v2\/posts\/565\/revisions"}],"predecessor-version":[{"id":570,"href":"https:\/\/www.kavdesign.net\/blog\/wp-json\/wp\/v2\/posts\/565\/revisions\/570"}],"wp:attachment":[{"href":"https:\/\/www.kavdesign.net\/blog\/wp-json\/wp\/v2\/media?parent=565"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kavdesign.net\/blog\/wp-json\/wp\/v2\/categories?post=565"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kavdesign.net\/blog\/wp-json\/wp\/v2\/tags?post=565"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}