Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/joomla/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/c/65.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Joomla joomfish rel=规范_Joomla_Joomla1.5_Joomfish - Fatal编程技术网

Joomla joomfish rel=规范

Joomla joomfish rel=规范,joomla,joomla1.5,joomfish,Joomla,Joomla1.5,Joomfish,我试图在joomla 1.5网站的标题中显示一个rel=canonical链接,但主要内容没有翻译 通过修改语言选择器模块,我成功地添加了指向其他语言的rel=alternative 我需要知道的是,在joomfish代码中,我可以检查主要内容是否已翻译,以及我的头代码在哪里 我查看了plugins->missing translation.php,并添加了以下代码: $doc=&JFactory::getDocument(); $getVars = JRequest::get( 'G

我试图在joomla 1.5网站的标题中显示一个rel=canonical链接,但主要内容没有翻译

通过修改语言选择器模块,我成功地添加了指向其他语言的rel=alternative

我需要知道的是,在joomfish代码中,我可以检查主要内容是否已翻译,以及我的头代码在哪里

我查看了plugins->missing translation.php,并添加了以下代码:

$doc=&JFactory::getDocument(); 
$getVars = JRequest::get( 'GET' );
$getVars['lang']='en';
$newURL = http_build_query($getVars);
$alternative=JRoute::_($newURL);
$customrel='<link rel="canonical" href="'.$alternative.'" />';
$doc->addCustomTag( $customrel );
标签会显示在头部,但会多次显示。我认为这是因为没有菜单项、模块等的翻译结果,所以代码会针对每个项目执行。我只希望它对主内容项执行,无论是com_内容还是其他组件


提前感谢

我在缺少的翻译中找到了这样做的方法,基本上我编写了一些条件语句,以发现此行是否是针对该行的请求的主要内容检查视图和id,并在构建规范url和显示标记之前检查它是否为默认语言。我必须检查系统内容中的每个组件类型、我的自定义组件等