Forum
Welcome, Guest
Please Login to access forum.
Re:Sitemaps in different languages using Falang (1 viewing) 
Go to bottom
TOPIC: Re:Sitemaps in different languages using Falang
#1496
Luca Pizzato
Fresh Boarder
Posts: 3
User Offline
Re:Sitemaps in different languages using Falang Karma: 0  
in the file components/com_jmap/views/sitemap/tmpl/default_xml_content.php [as a test]
line 40:
inside the if clause:

if (@$elm->slug) {

if($langCode == 'en'{
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select('fc.value'
->from('#__falang_content fc'
->where('fc.reference_id = '.(int) $elm->id)
->where('fc.language_id = 1' )
->where('fc.reference_field = \'alias\''
->where('fc.reference_table = \'content\'';
//$query->select('alias'->from('#__content'->where('id = ' . (int) $item->id);
$db->setQuery($query);
$alias = $db->loadResult();

if(!isset($alias)){
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select('alias'->from('#__content'->where('id = ' . (int) $elm->id);
$db->setQuery($query);
$alias = $db->loadResult();

}

$elm->slug = $elm->id.':'.$alias;

}




$seolink = JRoute::_ ( ContentHelperRoute::getArticleRoute ( $elm->slug, $elm->catslug, $elm->language ) );
}

the variable $langCode is my way to know if is asked the feed of the english language.
obviously this code is not final and works in my website with only two language.
hope it can help in some way
 
Logged Logged  
  The administrator has disabled public write access.
Go to top