Sábado, 25 Octubre 2014 03:38

beggarly

Patch suggestion: JoomFish Menu localisation support

Request new features on Xmap component
Forum rules
This

Patch suggestion: JoomFish Menu localisation support

Postby jville » Mon Oct 05, 2009 6:42 am

Joomla 1.5.13
JoomFish 2.1 pre-release
Xmap 1.2.1 and 1.2.2

I noticed that Xmap didn't work with JoomFish menu localisation and thus the menu items I marked not to show in certain languages showed in sitemap like this: http://www.site.com/index.php/en/component/content/100

I asked help from J!fish developers and they offered this patch to solve the problem:

You can fix this by editing the file components/com_xmap/xmap.php and replace lines 304-313 with the following

Code: Select all
$sql = "SELECT m.id, m.name, m.parent, m.link, m.type, m.browserNav, m.menutype, m.ordering, m.params, m.componentid,m.home, c.name AS component"
          . "\n FROM #__menu AS m"
          . "\n LEFT JOIN #__components AS c ON m.type='components' AND c.id=m.componentid"
          . "\n WHERE m.published='1' AND m.parent=".$menu->id." AND m.menutype = '".$menu->menutype."'"
          . ( $this->noauth ? '' : "\n AND m.access <= '". $this->gid ."'" )
          . "\n ORDER BY m.menutype,m.parent,m.ordering";

      // Load all menuentries
      $database->setQuery( $sql );
      $items = $database->loadObjectList();

      // Joomfish TWEAK
      $sitemenu = & JSite::getMenu();
      $allItems = $sitemenu->getMenu();
      $items = array();
      foreach ($allItems as  $item)
      {
         if ( ! is_object($item) )
            continue;

         if ($item->menutype == $menu->menutype && $item->parent == $menu->id && $item->access <= $this->gid)
         {
            $items[] = $item;
         }
      }

Also it will improve performance slighttly since there is one database query less via this method.

Could this be implemented in the next version?
jville
Fresh Boarder
Fresh Boarder
 
Posts: 2
Joined: Mon Oct 05, 2009 6:32 am

Re: Patch suggestion: JoomFish Menu localisation support

Postby jville » Thu Oct 29, 2009 6:29 am

Any thoughts if this feature could be added? I wouldn't want to keep hacking the source code.
jville
Fresh Boarder
Fresh Boarder
 
Posts: 2
Joined: Mon Oct 05, 2009 6:32 am

Re: Patch suggestion: JoomFish Menu localisation support

Postby Horoman » Mon Jul 05, 2010 11:44 am

I have the same problem but a newer version of XMap. The code of xmap.php has changed. So I don't know if I can just replace some code. My versions are:
Joomla: 1.5.18
JFish: 2.0
XMap: 1.2.8
Could someone please help me with that? Thank you.
Horoman
Fresh Boarder
Fresh Boarder
 
Posts: 2
Joined: Mon Jul 05, 2010 11:37 am

Re: Patch suggestion: JoomFish Menu localisation support

Postby Horoman » Mon Jul 05, 2010 12:10 pm

Well after searching with the keyword joomFish insted of jfish, I found the solution myself. I'm sorry for that post here. The solution is to add &lang=xx to the XMap Url.:
This is the english sitemap:
index.php?option=com_xmap&view=xml&sitemap=15& lang=en
This is the spanish sitemap:
index.php?option=com_xmap&view=xml&sitemap=1& lang=es

(remove the space between "&" and "lang")
Source:
http://joomla.vargas.co.cr/en/documentation/27-xmap/66-xmap-a-joomfish
Horoman
Fresh Boarder
Fresh Boarder
 
Posts: 2
Joined: Mon Jul 05, 2010 11:37 am


Return to New Features



Who is online

Users browsing this forum: No registered users and 3 guests

cron